#NEWLINE# def test_dropout_input_mask_value( ) : #NEWLINE# #INDENT# mlp = MLP ( nvis = 2 , layers = [ IdentityLayer ( 2 , 'h0' , irange = 0 ) ] ) #NEWLINE# mlp . layers [ 0 ] . set_weights ( np . eye ( 2 , dtype = mlp . get_weights ( ) . dtype ) ) #NEWLINE# mlp . layers [ 0 ] . set_biases ( np . arange ( 1 , 3 , dtype = mlp . get_weights ( ) . dtype ) ) #NEWLINE# mlp . layers [ 0 ] . dropout_input_mask_value = ( - np . inf ) #NEWLINE# inp = theano . tensor . matrix ( ) #NEWLINE# mode = theano . compile . mode . get_default_mode ( ) #NEWLINE# mode . check_isfinite = False #NEWLINE# f = theano . function ( [ f ] , mlp . masked_fprop ( inp , 1 , default_input_scale = 1 ) , allow_input_downcast = True , mode = mode ) #NEWLINE# np . testing . assert_equal ( f ( [ [ 4.0 , 3.0 ] ] ) , [ [ 4.0 , ( - np . inf ) ] ] )