73b2221b5eb4fd21802e6bf41e21d5df8ef9bf2c,src/sdk/pynni/nni/nas/pytorch/darts/trainer.py,DartsTrainer,_compute_hessian,#DartsTrainer#Any#Any#Any#Any#,119
Before Change
hessian = (dalpha { L_trn(w+, alpha) } - dalpha { L_trn(w-, alpha) }) / (2*eps)
eps = 0.01 / ||dw||
self.model.load_state_dict(model)
norm = torch.cat([w.view(-1) for w in dw]).norm()
eps = 0.01 / norm
After Change
for p, d in zip(self.model.parameters(), dw):
p += e * d
_ , loss = self._logits_and_loss(trn_X, trn_y)
dalphas.append(torch.autograd.grad(loss, self.mutator.parameters()))
dalpha_pos, dalpha_neg = dalphas // dalpha { L_trn(w+) }, // dalpha { L_trn(w-) }
In pattern: SUPERPATTERN
Frequency: 4
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: _compute_hessian
Project Name: google/uis-rnn
Commit Name: ac1f07e722b1117642774b04d96e7174751e325c
Time: 2018-10-18
Author: aonan@aonan.nyc.corp.google.com
File Name: demo.py
Class Name:
Method Name: diarization_experiment
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: stanfordnlp/stanza
Commit Name: b44d5bf6c87e3b857ca56e7a17c084d486da8d07
Time: 2018-10-15
Author: zyh@stanford.edu
File Name: models/lemma/trainer.py
Class Name: Trainer
Method Name: load