def buildMixedNestedNetwork():
 N = RecurrentNetwork('outer')
 a = LinearLayer(1, name='a')
 b = LinearLayer(2, name='b')
 c = buildNetwork(2, 3, 1)
 c.name = 'inner'
 N.addInputModule(a)
 N.addModule(c)
 N.addOutputModule(b)
 N.addConnection(FullConnection(a, b))
 N.addConnection(FullConnection(b, c))
 N.addRecurrentConnection(FullConnection(c, c))
 N.sortModules()
 return N

def buildMixedNestedNetwork ( ) : N = RecurrentNetwork ( 'outer' ) a = LinearLayer ( 1 , name = 'a' ) b = LinearLayer ( 2 , name = 'b' ) c = buildNetwork ( 2 , 3 , 1 ) c . name = 'inner' N . addInputModule ( a ) N . addModule ( c ) N . addOutputModule ( b ) N . addConnection ( FullConnection ( a , b ) ) N . addConnection ( FullConnection ( b , c ) ) N . addRecurrentConnection ( FullConnection ( c , c ) ) N . sortModules ( ) return N
build a nested network with the inner one being a ffn and the outer one being recurrent .