#NEWLINE# def test_get_layer_monitor_channels( ) : #NEWLINE# #INDENT# '\n    Create a MLP with multiple layer types\n    and get layer monitoring channels for MLP.\n    ' #NEWLINE# mlp = MLP ( layers = [ FlattenerLayer ( CompositeLayer ( 'composite' , [ Linear ( 10 , 'h0' , 0.1 ) , Linear ( 10 , 'h1' , 0.1 ) ] , { #NEWLINE# #INDENT# 0 : [ 1 ] , #NEWLINE# 1 : [ 0 ] , #NEWLINE# #UNINDENT# } ) ) , Softmax ( 5 , 'softmax' , 0.1 ) ] , input_space = CompositeSpace ( [ VectorSpace ( 15 ) , VectorSpace ( 20 ) ] ) , input_source = ( 'features0' , 'features1' ) ) #NEWLINE# dataset = VectorSpacesDataset ( ( np . random . rand ( 20 , 20 ) . astype ( theano . config . floatX ) , np . random . rand ( 20 , 15 ) . astype ( theano . config . floatX ) , np . random . rand ( 20 , 5 ) . astype ( theano . config . floatX ) ) , ( CompositeSpace ( [ VectorSpace ( 20 ) , VectorSpace ( 15 ) , VectorSpace ( 5 ) ] ) , ( 'features1' , 'features0' , 'targets' ) ) ) #NEWLINE# state_below = mlp . get_input_space ( ) . make_theano_batch ( ) #NEWLINE# targets = mlp . get_target_space ( ) . make_theano_batch ( ) #NEWLINE# mlp . get_layer_monitoring_channels ( state_below = state_below , state = None , targets = dataset )