#NEWLINE# def test_xor( self ) : #NEWLINE# #INDENT# mlp = self . trainMLP_xor ( ) #NEWLINE# o = mlp . outputs . values ( ) [ 0 ] #NEWLINE# pa = mlp . predictionAccuracy ( o , inp = self . xor_ins , targets = self . xor_outs ) [ 0 ] #NEWLINE# self . assertEqual ( pa , 1 ) #NEWLINE# pc = mlp . classificationAccuracy ( o , inp = self . xor_ins , targets = self . xor_outs ) [ 0 ] #NEWLINE# self . assertEqual ( pc , 1 ) #NEWLINE# self . assertEqual ( mlp . classify ( o , inp = [ self . xor_ins [ 0 ] ] ) [ 0 ] , 0 ) #NEWLINE# self . assertEqual ( mlp . classify ( o , inp = [ self . xor_ins [ 1 ] ] ) [ 0 ] , 1 ) #NEWLINE# self . assertEqual ( mlp . classify ( o , inp = [ self . xor_ins [ 2 ] ] ) [ 0 ] , 1 ) #NEWLINE# self . assertEqual ( mlp . classify ( o , inp = [ self . xor_ins [ 3 ] ] ) [ 0 ] , 0 )