bea3a486261d3f6238316224605b684db1e5bca7,Tars/models/vae.py,VAE,train,#VAE#Any#,40
Before Change
self.other_distributions.train()
self.optimizer.zero_grad()
lower_bound, loss = self._elbo(train_x)
// backprop
loss.backward()
// update params
self.optimizer.step()
return lower_bound, loss
def test(self, test_x):
self.decoder.eval()
self.encoder.eval()
After Change
self.encoder.train()
self.other_distributions.train()
return super().train(train_x, **kwargs)
def test(self, test_x, **kwargs):
self.decoder.eval()
self.encoder.eval()
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 7
Instances
Project Name: masa-su/pixyz
Commit Name: bea3a486261d3f6238316224605b684db1e5bca7
Time: 2018-10-16
Author: masa@weblab.t.u-tokyo.ac.jp
File Name: Tars/models/vae.py
Class Name: VAE
Method Name: train
Project Name: masa-su/pixyz
Commit Name: bea3a486261d3f6238316224605b684db1e5bca7
Time: 2018-10-16
Author: masa@weblab.t.u-tokyo.ac.jp
File Name: Tars/models/vae.py
Class Name: VAE
Method Name: train
Project Name: masa-su/pixyz
Commit Name: bea3a486261d3f6238316224605b684db1e5bca7
Time: 2018-10-16
Author: masa@weblab.t.u-tokyo.ac.jp
File Name: Tars/models/vi.py
Class Name: VI
Method Name: test
Project Name: masa-su/pixyz
Commit Name: bea3a486261d3f6238316224605b684db1e5bca7
Time: 2018-10-16
Author: masa@weblab.t.u-tokyo.ac.jp
File Name: Tars/models/vae.py
Class Name: VAE
Method Name: test
Project Name: masa-su/pixyz
Commit Name: bea3a486261d3f6238316224605b684db1e5bca7
Time: 2018-10-16
Author: masa@weblab.t.u-tokyo.ac.jp
File Name: Tars/models/vi.py
Class Name: VI
Method Name: train