Merge (pyeddl.layers.merge
)¶
Layer that adds a list of inputs. |
|
Layer that concatenates a list of inputs. |
Add¶
-
class
pyeddl.layers.merge.
Add
(**kwargs)[source]¶ Layer that adds a list of inputs.
It takes as input a list of tensors, all of the same shape, and returns a single tensor (also of the same shape).
- Example:
- ```python
import pyeddl input1 = pyeddl.layers.Input(shape=(16,)) x1 = pyeddl.layers.Dense(8, activation=’relu’)(input1) input2 = pyeddl.layers.Input(shape=(32,)) x2 = pyeddl.layers.Dense(8, activation=’relu’)(input2) # equivalent to added = pyeddl.layers.add([x1, x2]) added = pyeddl.layers.Add()([x1, x2]) out = pyeddl.layers.Dense(4)(added) model = pyeddl.models.Model(inputs=[input1, input2], outputs=out)
Concatenate¶
-
class
pyeddl.layers.merge.
Concatenate
(axis=-1, **kwargs)[source]¶ Layer that concatenates a list of inputs.
It takes as input a list of tensors, all of the same shape except for the concatenation axis, and returns a single tensor, the concatenation of all inputs.
- Args:
axis: Axis along which to concatenate. **kwargs: standard layer keyword arguments.