MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / add

Function add

tensorflow/python/keras/layers/merge.py:562–587  ·  view source on GitHub ↗

Functional interface to the `Add` layer. Arguments: inputs: A list of input tensors (at least 2). **kwargs: Standard layer keyword arguments. Returns: A tensor, the sum of the inputs. Examples: ```python import keras input1 = keras.layers.Input(shape=(16,))

(inputs, **kwargs)

Source from the content-addressed store, hash-verified

560
561@keras_export('keras.layers.add')
562def add(inputs, **kwargs):
563 """Functional interface to the `Add` layer.
564
565 Arguments:
566 inputs: A list of input tensors (at least 2).
567 **kwargs: Standard layer keyword arguments.
568
569 Returns:
570 A tensor, the sum of the inputs.
571
572 Examples:
573
574 ```python
575 import keras
576
577 input1 = keras.layers.Input(shape=(16,))
578 x1 = keras.layers.Dense(8, activation='relu')(input1)
579 input2 = keras.layers.Input(shape=(32,))
580 x2 = keras.layers.Dense(8, activation='relu')(input2)
581 added = keras.layers.add([x1, x2])
582
583 out = keras.layers.Dense(4)(added)
584 model = keras.models.Model(inputs=[input1, input2], outputs=out)
585 ```
586 """
587 return Add(**kwargs)(inputs)
588
589
590@keras_export('keras.layers.subtract')

Callers 15

testCollectionMethod · 0.50
fnMethod · 0.50
callMethod · 0.50
testSameVariableTwiceMethod · 0.50
testCompositionMethod · 0.50
testVariableMethod · 0.50
testVariableOnlyMethod · 0.50
add_oneMethod · 0.50
testRegisterFunctionMethod · 0.50

Calls 1

AddClass · 0.70

Tested by 14

testCollectionMethod · 0.40
fnMethod · 0.40
testSameVariableTwiceMethod · 0.40
testCompositionMethod · 0.40
testVariableMethod · 0.40
testVariableOnlyMethod · 0.40
add_oneMethod · 0.40
testRegisterFunctionMethod · 0.40
py_compositeMethod · 0.40