def test_input_discard():
 mlp = MLP(layers=[FlattenerLayer(CompositeLayer('composite', [Linear(10, 'h0', 0.1)], {0: [0], 1: []})), Softmax(5, 'softmax', 0.1)], input_space=CompositeSpace([VectorSpace(15), VectorSpace(20)]), input_source=('features0', 'features1'))
 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')))
 train = Train(dataset, mlp, SGD(0.1, batch_size=5))
 train.algorithm.termination_criterion = EpochCounter(1)
 train.main_loop()

def test_input_discard ( ) : mlp = MLP ( layers = [ FlattenerLayer ( CompositeLayer ( 'composite' , [ Linear ( 10 , 'h0' , 0.1 ) ] , { 0 : [ 0 ] , 1 : [ ] } ) ) , Softmax ( 5 , 'softmax' , 0.1 ) ] , input_space = CompositeSpace ( [ VectorSpace ( 15 ) , VectorSpace ( 20 ) ] ) , input_source = ( 'features0' , 'features1' ) ) 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' ) ) ) train = Train ( dataset , mlp , SGD ( 0.1 , batch_size = 5 ) ) train . algorithm . termination_criterion = EpochCounter ( 1 ) train . main_loop ( )
create a vectorspacesdataset with two inputs and train an mlp which discards one input with a compositelayer .