deepr.layers.Parallel

class deepr.layers.Parallel(*layers)[source]

Apply layers in parallel on consecutive inputs.

If you have 2 layers F(a, b) -> x and G(c) -> (y, z), it defines a layer H(a, b, c) -> (x, y, z). For example:

layer1 = Add(inputs="x1, x2", outputs="y1")
layer2 = OffsetLayer(offset=1, inputs="x3", outputs="y2")
layer = deepr.layers.Parallel(layer1, layer2)
layer((1, 1, 2))  # (2, 3)
layer({"x1": 1, "x2": 1, "x3": 2})  # {"y1": 2, "y2": 3}
__init__(*layers)[source]

Methods

__init__(*layers)

forward(tensors[, mode])

Forward method of the layer

forward_as_dict(tensors[, mode])

Forward method on a dictionary of Tensors.