#NEWLINE# def test_binary_cross_entropy( ) : #NEWLINE# #INDENT# batch_size = 13 #NEWLINE# input_dim = 32 #NEWLINE# rng = np . random . RandomState ( 42 ) #NEWLINE# targets = ( rng . rand ( batch_size , input_dim ) > 0.5 ) . astype ( np . float32 ) #NEWLINE# dataset = DummyDataset ( ) #NEWLINE# dataset . symb_targets = targets #NEWLINE# loss = BinaryCrossEntropy ( DummyModel ( ) , dataset ) #NEWLINE# model_output = rng . rand ( batch_size , input_dim ) . astype ( np . float32 ) #NEWLINE# losses = loss . _compute_losses ( model_output ) . eval ( ) #NEWLINE# assert_equal ( input_dim . shape , ( batch_size , ) )