de7f5863338af5e1f92257cb29a6ca9a1c52c473,deepchem/metalearning/tests/test_maml.py,TestMAML,test_sine,#TestMAML#,12
Before Change
new_maml = dc.metalearning.MAML(learner, model_dir=maml.model_dir)
new_maml.fit(0, restore=True)
feed_dict = {}
for j in range(len(batch)):
feed_dict[new_maml._input_placeholders[j]] = batch[j]
feed_dict[new_maml._meta_placeholders[j]] = batch[j]
new_loss = np.average(
np.sqrt(new_maml._session.run(new_maml._loss, feed_dict=feed_dict)))
assert new_loss == loss1[-1]
After Change
new_maml = dc.metalearning.MAML(learner, model_dir=maml.model_dir)
new_maml.restore()
loss, outputs = new_maml.predict_on_batch(batch)
assert np.sqrt(loss) == loss1[-1]
// Do the same thing, only using the "restore" argument to fit().
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances 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: dpressel/mead-baseline
Commit Name: 192c521848ffa30207b9b507056880e08ac173f0
Time: 2018-08-31
Author: dpressel@gmail.com
File Name: python/baseline/keras/classify/train.py
Class Name: ClassifyTrainerKeras
Method Name: _test