

def buildSlicedNetwork():
    ' build a network with shared connections. Two hidden modules are\n    symmetrically linked, but to a different input neuron than the\n    output neuron. The weights are random. '
    N = FeedForwardNetwork('sliced')
    a = LinearLayer(2, name='a')
    b = LinearLayer(2, name='b')
    N.addInputModule(a)
    N.addOutputModule(b)
    N.addConnection(FullConnection(a, b, inSliceTo=1, outSliceFrom=1))
    N.addConnection(FullConnection(a, b, inSliceFrom=1, outSliceTo=1))
    N.sortModules()
    return N

dataset/ETHPy150Open pybrain/pybrain/pybrain/tests/unittests/structure/connections/test_sliced_connections.py buildSlicedNetwork/original