#NEWLINE# def test_windowlayer( ) : #NEWLINE# #INDENT# '\n    Tests that WindowLayer reacts correctly to the error in window\n    settings, and that the window gives the correct results.\n\n    Parameters\n    ----------\n    No Parameter\n    ' #NEWLINE# np . testing . assert_raises ( ValueError , build_mlp_fn , 0 , 0 , 20 , 20 , 20 , 20 , 3 , ( 'c' , 0 , 1 , 'b' ) ) #NEWLINE# np . testing . assert_raises ( ValueError , build_mlp_fn , ( - 1 ) , ( - 1 ) , 19 , 19 , 20 , 20 , 3 , ( 'c' , 0 , 1 , 'b' ) ) #NEWLINE# fprop = build_mlp_fn ( 5 , 5 , 10 , 15 , 20 , 20 , 2 , ( 'b' , 'c' , 0 , 1 ) ) #NEWLINE# n = np . random . rand ( 3 , 2 , 20 , 20 ) . astype ( theano . config . floatX ) #NEWLINE# r = fprop ( n ) #NEWLINE# assert ( r . shape == ( 3 , 2 , 6 , 11 ) ) #NEWLINE# assert ( r [ ( 0 , 0 , 0 , 0 ) ] == n [ ( 0 , 0 , 5 , 5 ) ] ) #NEWLINE# assert ( r [ ( 2 , 1 , 5 , 10 ) ] == n [ ( 2 , 1 , 10 , 15 ) ] ) #NEWLINE# assert ( r [ ( 1 , 1 , 3 , 3 ) ] == n [ ( 1 , 1 , 8 , 8 ) ] )