#NEWLINE# def test_masking_layer( ) : #NEWLINE# #INDENT# ' This test based on a previously failing issue here:\n    https://github.com/fchollet/keras/issues/1567\n\n    ' #NEWLINE# model = Sequential ( ) #NEWLINE# model . add ( Masking ( input_shape = ( 3 , 4 ) ) ) #NEWLINE# model . add ( recurrent . LSTM ( output_dim = 5 , return_sequences = True ) ) #NEWLINE# model . compile ( loss = 'categorical_crossentropy' , optimizer = 'adam' ) #NEWLINE# I = np . random . random ( ( 6 , 3 , 4 ) ) #NEWLINE# V = np . abs ( np . random . random ( ( 6 , 3 , 5 ) ) ) #NEWLINE# V /= V . sum ( axis = ( - 1 ) , keepdims = True ) #NEWLINE# model . fit ( model , V , nb_epoch = 1 , batch_size = 100 , verbose = 1 )