Exemple #1
0
 def fit(self,
         model,
         x=None,
         y=None,
         batch_size=None,
         epochs=1,
         verbose=1,
         callbacks=None,
         validation_split=0.,
         validation_data=None,
         shuffle=True,
         class_weight=None,
         sample_weight=None,
         initial_epoch=0,
         steps_per_epoch=None,
         validation_steps=None,
         validation_freq=1,
         max_queue_size=10,
         workers=1,
         use_multiprocessing=False):
   model._validate_or_infer_batch_size(batch_size, steps_per_epoch, x)
   training_utils.check_generator_arguments(
       y, sample_weight, validation_split=validation_split)
   return fit_generator(
       model,
       x,
       steps_per_epoch=steps_per_epoch,
       epochs=epochs,
       verbose=verbose,
       callbacks=callbacks,
       validation_data=validation_data,
       validation_steps=validation_steps,
       validation_freq=validation_freq,
       class_weight=class_weight,
       max_queue_size=max_queue_size,
       workers=workers,
       use_multiprocessing=use_multiprocessing,
       shuffle=shuffle,
       initial_epoch=initial_epoch,
       steps_name='steps_per_epoch')
Exemple #2
0
 def evaluate(self,
              model,
              x=None,
              y=None,
              batch_size=None,
              verbose=1,
              sample_weight=None,
              steps=None,
              callbacks=None,
              max_queue_size=10,
              workers=1,
              use_multiprocessing=False):
     model._validate_or_infer_batch_size(batch_size, steps, x)
     training_utils.check_generator_arguments(y, sample_weight)
     return evaluate_generator(model,
                               x,
                               steps=steps,
                               verbose=verbose,
                               callbacks=callbacks,
                               max_queue_size=max_queue_size,
                               workers=workers,
                               use_multiprocessing=use_multiprocessing)