neupy.layers.parallel

neupy.layers.parallel(*networks)[source]

Merges all networks/layers into single network without joining input and output layers together.

Parameters:
*networks

Layers or networks. Each network can be specified as a list or tuple. In this case, this input will be passed to the join function in order to create full network from the specified list of the connections.

Examples

>>> from neupy.layers import *
>>> network = parallel(
...     Input(10),
...     Input(9) >> Relu(5),
...     Relu(5),
... )
[(?, 10), (?, 9), <unknown>] -> [... 4 layers ...] ->     [(?, 10), (?, 5), (?, 5)]

Networks can be specified as a list of layers.

>>> from neupy.layers import *
>>> network = parallel([
...     Input((28, 28, 1)),
...     Convolution((3, 3, 16)),
... ], [
...     Input((28, 28, 1)),
...     Convolution((3, 3, 12)),
... ])
>>>
>>> network
[(?, 28, 28, 1), (?, 28, 28, 1)] -> [... 4 layers ...] ->     [(?, 26, 26, 16), (?, 26, 26, 12)]