twodlearn.parallel module

class twodlearn.parallel.ParallelLayers(trainable=True, name=None, *args, **kwargs)[source]

Bases: twodlearn.core.layers.Layer

Layer that is composed of several parallel layers.

Tdl autoinitialization with arguments:

input_shape[source]

(InputArgument) Input tensor shape.

layers[source]

(Submodel) Layers that are executed sequentially.

add(layer)[source]

Add a new layer to the stacked model. The only condition is that layer must be callable.

build(input_shape=None)[source]

Build the model. Note that this function does not build the layers.

call(inputs, *args, **kargs)[source]

Call the layers in sequential order.

compute_output_shape(input_shape=None)[source]

Computes the output shape of the layer.

Assumes that the layer will be built to match that input shape provided.

Parameters

input_shape – Shape tuple (tuple of integers) or list of shape tuples (one per output tensor of the layer). Shape tuples can include None for free dimensions, instead of an integer.

Returns

An input shape tuple.

input_shape[source]

Input tensor shape.

layers[source]

Layers that are executed sequentially.