00135a70697dc9b4611971e5833e2d84501c3da7,keras/engine/training.py,Model,train_step,#Model#Any#,747

Before Change


          y, y_pred, sample_weight, regularization_losses=self.losses)
    self.optimizer.minimize(loss, self.trainable_variables, tape=tape)
    self.compiled_metrics.update_state(y, y_pred, sample_weight)
    return {m.name: m.result() for m in self.metrics}

  def make_train_function(self):
    Creates a function that executes one step of training.

After Change


    self.optimizer.minimize(loss, self.trainable_variables, tape=tape)
    self.compiled_metrics.update_state(y, y_pred, sample_weight)
    // Collect metrics to return
    return_metrics = {}
    for metric in self.metrics:
      result = metric.result()
      if isinstance(result, dict):
        return_metrics.update(result)
      else:
        return_metrics[metric.name] = result
    return return_metrics

  def make_train_function(self):
    Creates a function that executes one step of training.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 16

Instances


Project Name: keras-team/keras
Commit Name: 00135a70697dc9b4611971e5833e2d84501c3da7
Time: 2021-03-23
Author: scottzhu@google.com
File Name: keras/engine/training.py
Class Name: Model
Method Name: train_step


Project Name: keras-team/keras
Commit Name: 00135a70697dc9b4611971e5833e2d84501c3da7
Time: 2021-03-23
Author: scottzhu@google.com
File Name: keras/engine/training.py
Class Name: Model
Method Name: test_step


Project Name: NTMC-Community/MatchZoo
Commit Name: e63c463a3200d9843bc5be6c1c3ee36fb267cbde
Time: 2018-12-29
Author: i@uduse.com
File Name: matchzoo/engine/param_table.py
Class Name: ParamTable
Method Name: hyper_space