#NEWLINE# def _standardize_user_data( self , x , y , sample_weight = None , class_weight = None , check_batch_dim = True , batch_size = None ) : #NEWLINE# #INDENT# if ( not hasattr ( self , 'optimizer' ) ) : #NEWLINE# #INDENT# raise Exception ( 'You must compile a model before training/testing. Use `model.compile(optimizer, loss)`.' ) #NEWLINE# #UNINDENT# x = standardize_input_data ( x , self . input_names , self . internal_input_shapes , check_batch_dim = False , exception_prefix = 'model input' ) #NEWLINE# y = standardize_input_data ( y , self . output_names , self . internal_output_shapes , check_batch_dim = False , exception_prefix = 'model target' ) #NEWLINE# sample_weights = standardize_sample_weights ( sample_weight , self . output_names ) #NEWLINE# class_weights = standardize_class_weights ( class_weight , self . output_names ) #NEWLINE# sample_weights = [ standardize_weights ( ref , sw , cw , mode ) for ( ref , sw , cw , mode ) in zip ( y , sample_weights , class_weights , self . sample_weight_modes ) ] #NEWLINE# check_array_lengths ( x , y , sample_weights ) #NEWLINE# check_loss_and_target_compatibility ( y , self . loss_functions , self . internal_output_shapes ) #NEWLINE# if ( self . stateful and batch_size ) : #NEWLINE# #INDENT# if ( ( x [ 0 ] . shape [ 0 ] % batch_size ) != 0 ) : #NEWLINE# #INDENT# raise Exception ( ( ( 'In a stateful network, you should only pass inputs with a number of samples that can be divided by the batch size. Found: ' + str ( x [ 0 ] . shape [ 0 ] ) ) + ' samples' ) ) #NEWLINE# #UNINDENT# #UNINDENT# return ( x , y , sample_weights )