#NEWLINE# def test_GetParamsThenConstructor( self ) : #NEWLINE# #INDENT# nn1 = MLPR ( layers = [ L ( 'Linear' ) ] , n_iter = 1 ) #NEWLINE# ( a_in , a_out ) = ( numpy . zeros ( ( 8 , 16 ) ) , numpy . zeros ( ( 8 , 4 ) ) ) #NEWLINE# nn1 . _initialize ( a_in , a_out ) #NEWLINE# p1 = nn1 . get_parameters ( ) #NEWLINE# print ( len ( p1 ) ) #NEWLINE# nn2 = MLPR ( layers = [ L ( 'Linear' ) ] , n_iter = 1 , parameters = p1 ) #NEWLINE# nn2 . _initialize ( a_in , a_out ) #NEWLINE# p2 = nn2 . get_parameters ( ) #NEWLINE# print ( len ( p2 ) ) #NEWLINE# assert_true ( ( p1 [ 0 ] . weights . astype ( 'float32' ) == p2 [ 0 ] . weights . astype ( 'float32' ) ) . all ( ) ) #NEWLINE# assert_true ( ( p1 [ 0 ] . biases . astype ( 'float32' ) == p2 [ 0 ] . biases . astype ( 'float32' ) ) . all ( ) )