MCPcopy Create free account
hub / github.com/Tencent/NeuralNLP-NeuralClassifier / update_lr

Method update_lr

model/classification/classifier.py:119–127  ·  view source on GitHub ↗

Update lr

(self, optimizer, epoch)

Source from the content-addressed store, hash-verified

117 return params
118
119 def update_lr(self, optimizer, epoch):
120 """Update lr
121 """
122 if epoch > self.config.train.num_epochs_static_embedding:
123 for param_group in optimizer.param_groups[:2]:
124 param_group["lr"] = self.config.optimizer.learning_rate
125 else:
126 for param_group in optimizer.param_groups[:2]:
127 param_group["lr"] = 0
128
129 def forward(self, batch):
130 raise NotImplementedError

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected