W3cubDocs

/TensorFlow 2.4

tf.keras.layers.Minimum

Layer that computes the minimum (element-wise) a list of inputs.

Inherits From: Layer, Module

It takes as input a list of tensors, all of the same shape, and returns a single tensor (also of the same shape).

tf.keras.layers.Minimum()([np.arange(5).reshape(5, 1),
                           np.arange(5, 10).reshape(5, 1)])
<tf.Tensor: shape=(5, 1), dtype=int64, numpy=
array([[0],
     [1],
     [2],
     [3],
     [4]])>
x1 = tf.keras.layers.Dense(8)(np.arange(10).reshape(5, 2))
x2 = tf.keras.layers.Dense(8)(np.arange(10, 20).reshape(5, 2))
minned = tf.keras.layers.Minimum()([x1, x2])
minned.shape
TensorShape([5, 8])
Arguments
**kwargs standard layer keyword arguments.

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.4/api_docs/python/tf/keras/layers/Minimum