bea3a486261d3f6238316224605b684db1e5bca7,Tars/models/custom_loss_model.py,CustomLossModel,train,#CustomLossModel#Any#,36

Before Change


        self.distributions.train()

        self.optimizer.zero_grad()
        loss = self.loss_cls.estimate(train_x).mean()

        // backprop
        loss.backward()

After Change


    def train(self, train_x, **kwargs):
        self.distributions.train()

        return super().train(train_x, **kwargs)

    def test(self, test_x, **kwargs):
        self.distributions.eval()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

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/custom_loss_model.py
Class Name: CustomLossModel
Method Name: train


Project Name: markovmodel/PyEMMA
Commit Name: 8eb245e807e5cbcac40f39024bb45283bc03e75a
Time: 2016-12-13
Author: feliks.nueske@fu-berlin.de
File Name: pyemma/coordinates/estimation/covariance.py
Class Name: EquilibriumCorrectedCovarEstimator
Method Name: _estimate


Project Name: masa-su/pixyz
Commit Name: bea3a486261d3f6238316224605b684db1e5bca7
Time: 2018-10-16
Author: masa@weblab.t.u-tokyo.ac.jp
File Name: Tars/models/custom_loss_model.py
Class Name: CustomLossModel
Method Name: test