tf.keras.layers.maximum
Functional interface to compute maximum (element-wise) list of inputs
.
tf.keras.layers.maximum(
inputs, **kwargs
)
This is equivalent to the tf.keras.layers.Maximum
layer.
For example:
input1 = tf.keras.layers.Input(shape=(16,))
x1 = tf.keras.layers.Dense(8, activation='relu')(input1) #shape=(None, 8)
input2 = tf.keras.layers.Input(shape=(32,))
x2 = tf.keras.layers.Dense(8, activation='relu')(input2) #shape=(None, 8)
max_inp=tf.keras.layers.maximum([x1,x2]) #shape=(None, 8)
out = tf.keras.layers.Dense(4)(max_inp)
model = tf.keras.models.Model(inputs=[input1, input2], outputs=out)
Arguments |
inputs
|
A list of input tensors (at least 2) of same shape.
|
**kwargs
|
Standard layer keyword arguments.
|
Returns |
A tensor (of same shape as input tensor) with the element-wise
maximum of the inputs.
|
Raises |
ValueError
|
If input tensors are of different shape.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[]]