73b2221b5eb4fd21802e6bf41e21d5df8ef9bf2c,src/sdk/pynni/nni/nas/pytorch/darts/trainer.py,DartsTrainer,train_one_epoch,#DartsTrainer#Any#,43

Before Change



            // phase 1. child network step
            self.optimizer.zero_grad()
            self.mutator.reset()
            logits = self.model(trn_X)
            loss = self.loss(logits, trn_y)
            loss.backward()
            // gradient clipping

After Change



            // phase 2: child network step
            self.optimizer.zero_grad()
            logits, loss = self._logits_and_loss(trn_X, trn_y)
            loss.backward()
            nn.utils.clip_grad_norm_(self.model.parameters(), 5.)  // gradient clipping
            self.optimizer.step()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: microsoft/nni
Commit Name: 73b2221b5eb4fd21802e6bf41e21d5df8ef9bf2c
Time: 2019-11-22
Author: v-yugzh@microsoft.com
File Name: src/sdk/pynni/nni/nas/pytorch/darts/trainer.py
Class Name: DartsTrainer
Method Name: train_one_epoch


Project Name: microsoft/nni
Commit Name: 73b2221b5eb4fd21802e6bf41e21d5df8ef9bf2c
Time: 2019-11-22
Author: v-yugzh@microsoft.com
File Name: src/sdk/pynni/nni/nas/pytorch/darts/trainer.py
Class Name: DartsTrainer
Method Name: _compute_hessian


Project Name: ray-project/ray
Commit Name: ce96b03b07a4a4bdd851aa84493c616cd291aff2
Time: 2020-10-06
Author: sven@anyscale.io
File Name: rllib/examples/env/mbmpo_env.py
Class Name:
Method Name: