387e650e16a5405691fb18ce05b34bd90239180e,deepchem/metalearning/tests/test_maml.py,TestMAML,test_sine,#TestMAML#,12

Before Change


      batch = learner.get_batch()
      feed_dict = {}
      for j in range(len(batch)):
        feed_dict[maml._input_placeholders[j]] = batch[j]
        feed_dict[maml._meta_placeholders[j]] = batch[j]
      loss1.append(
          np.average(
              np.sqrt(maml._session.run(maml._loss, feed_dict=feed_dict))))
      loss2.append(
          np.average(
              np.sqrt(maml._session.run(maml._meta_loss, feed_dict=feed_dict))))

After Change


      loss, outputs = maml.predict_on_batch(batch)
      loss1.append(np.sqrt(loss))
      maml.train_on_current_task()
      loss, outputs = maml.predict_on_batch(batch)
      loss2.append(np.sqrt(loss))

    // Initially the model should do a bad job of fitting the sine function.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: deepchem/deepchem
Commit Name: 387e650e16a5405691fb18ce05b34bd90239180e
Time: 2020-01-31
Author: peastman@stanford.edu
File Name: deepchem/metalearning/tests/test_maml.py
Class Name: TestMAML
Method Name: test_sine


Project Name: deepchem/deepchem
Commit Name: de7f5863338af5e1f92257cb29a6ca9a1c52c473
Time: 2019-07-10
Author: peastman@stanford.edu
File Name: deepchem/metalearning/tests/test_maml.py
Class Name: TestMAML
Method Name: test_sine


Project Name: deepchem/deepchem
Commit Name: 387e650e16a5405691fb18ce05b34bd90239180e
Time: 2020-01-31
Author: peastman@stanford.edu
File Name: deepchem/metalearning/tests/test_maml.py
Class Name: TestMAML
Method Name: test_sine


Project Name: deepchem/deepchem
Commit Name: de7f5863338af5e1f92257cb29a6ca9a1c52c473
Time: 2019-07-10
Author: peastman@stanford.edu
File Name: examples/low_data/toxcast_maml.py
Class Name:
Method Name: compute_scores