(self, step, data=None)
Print debug info to the log
Print debug info to the log
Print debug info to the log
def _print_log(self, step, data=None):
        """
        Print debug info to the log
        """
        
        # Set mode to append to log file
        mode = 'a'

        if step == 1:
            # Output the updated input shape
            output = "Input shape specification for Keras: {0}\n\n".format(self.first_layer_kwargs['input_shape'])
        elif step == 2:
            # Output the updated input shape
            output = "{0} samples added to the input shape. Data will be reshaped to: {1}\n\n".format(data[0], tuple(data))
        elif step == 3:
            # Output sample data after reshaping
            output = "Input data reshaped to {0}.\nSample Data:\n{1}\n\n".format(data.shape, data[:5])

        sys.stdout.write(output)
        with open(self.logfile, mode, encoding='utf-8') as f:
            f.write(output)
def _print_log ( self , step , data = None ) : # Set mode to append to log file mode = 'a' if step == 1 : # Output the updated input shape output = "Input shape specification for Keras: {0}\n\n" . format ( self . first_layer_kwargs [ 'input_shape' ] ) elif step == 2 : # Output the updated input shape output = "{0} samples added to the input shape. Data will be reshaped to: {1}\n\n" . format ( data [ 0 ] , tuple ( data ) ) elif step == 3 : # Output sample data after reshaping output = "Input data reshaped to {0}.\nSample Data:\n{1}\n\n" . format ( data . shape , data [ : 5 ] ) sys . stdout . write ( output ) with open ( self . logfile , mode , encoding = 'utf-8' ) as f : f . write ( output )