Python tensorflow.keras.layers.GlobalMaxPooling2D() Examples

The following are 1 code examples of tensorflow.keras.layers.GlobalMaxPooling2D(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module tensorflow.keras.layers , or try the search function .
Example #1
Source File: convert_test.py    From tf-encrypted with Apache License 2.0 5 votes vote down vote up
def _keras_global_maxpool_core(shape=None, data=None):
    assert shape is None or data is None
    if shape is None:
        shape = data.shape

    model = Sequential()
    layer = GlobalMaxPooling2D(input_shape=shape[1:], data_format="channels_last")
    model.add(layer)

    if data is None:
        data = np.random.uniform(size=shape)
    out = model.predict(data)
    return model, out