def buildSimpleBorderSwipingNet(size=3, dim=3, hsize=1, predefined={}):
 dims = tuple(([size] * dim))
 hdims = tuple((list(dims) + [(2 ** dim)]))
 inmod = LinearLayer((size ** dim), name='input')
 inmesh = ModuleMesh.viewOnFlatLayer(inmod, dims, 'inmesh')
 outmod = LinearLayer((size ** dim), name='output')
 outmesh = ModuleMesh.viewOnFlatLayer(outmod, dims, 'outmesh')
 hiddenmesh = ModuleMesh.constructWithLayers(TanhLayer, hsize, hdims, 'hidden')
 return BorderSwipingNetwork(inmesh, hiddenmesh, outmesh, predefined=predefined)

def buildSimpleBorderSwipingNet ( size = 3 , dim = 3 , hsize = 1 , predefined = { } ) : dims = tuple ( ( [ size ] * dim ) ) hdims = tuple ( ( list ( dims ) + [ ( 2 ** dim ) ] ) ) inmod = LinearLayer ( ( size ** dim ) , name = 'input' ) inmesh = ModuleMesh . viewOnFlatLayer ( inmod , dims , 'inmesh' ) outmod = LinearLayer ( ( size ** dim ) , name = 'output' ) outmesh = ModuleMesh . viewOnFlatLayer ( outmod , dims , 'outmesh' ) hiddenmesh = ModuleMesh . constructWithLayers ( TanhLayer , hsize , hdims , 'hidden' ) return BorderSwipingNetwork ( inmesh , hiddenmesh , outmesh , predefined = predefined )
build a simple swiping network .