387e650e16a5405691fb18ce05b34bd90239180e,deepchem/metalearning/maml.py,MAML,fit,#MAML#Any#Any#Any#Any#,202

Before Change


        inputs = self.learner.get_batch()
        feed_dict = {}
        feed_dict[self._global_step] = i
        for k in range(len(inputs)):
          feed_dict[self._input_placeholders[k]] = inputs[k]
          feed_dict[self._meta_placeholders[k]] = inputs[k]
        self._session.run(self._add_gradients, feed_dict=feed_dict)
      self._session.run(self._meta_train_op)

      // Do checkpointing.

After Change


        learner.select_task()
        meta_loss, meta_gradients = self._compute_meta_loss(
            learner.get_batch(), learner.get_batch(), variables)
        if j == 0:
          summed_gradients = meta_gradients
        else:
          summed_gradients = [
              s + g for s, g in zip(summed_gradients, meta_gradients)
          ]
      self._tf_optimizer.apply_gradients(zip(summed_gradients, variables))

      // Do checkpointing.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 10

Instances


Project Name: deepchem/deepchem
Commit Name: 387e650e16a5405691fb18ce05b34bd90239180e
Time: 2020-01-31
Author: peastman@stanford.edu
File Name: deepchem/metalearning/maml.py
Class Name: MAML
Method Name: fit


Project Name: Esri/raster-functions
Commit Name: 372cc580b234724920fee6045e0151abb2b8a823
Time: 2014-09-09
Author: akferoz@esri.com
File Name: Aggregation.py
Class Name: Aggregation
Method Name: updatePixels


Project Name: deepchem/deepchem
Commit Name: 387e650e16a5405691fb18ce05b34bd90239180e
Time: 2020-01-31
Author: peastman@stanford.edu
File Name: deepchem/metalearning/maml.py
Class Name: MAML
Method Name: fit


Project Name: OpenMined/PySyft
Commit Name: 59d4bbaaf06850e2dfb357855f50b05f6c9aadb1
Time: 2020-10-02
Author: skywind29@users.noreply.github.com
File Name: syft/frameworks/torch/fl/utils.py
Class Name:
Method Name: federated_avg


Project Name: allenai/allennlp
Commit Name: 5ad7a33a04d8829ad3439b5f9390bd136105f986
Time: 2020-05-28
Author: tobiasr@allenai.org
File Name: allennlp/nn/beam_search.py
Class Name: BeamSearch
Method Name: search