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

Method update_lr

model/classification/textcnn.py:46–54  ·  view source on GitHub ↗

Update lr

(self, optimizer, epoch)

Source from the content-addressed store, hash-verified

44 return params
45
46 def update_lr(self, optimizer, epoch):
47 """Update lr
48 """
49 if epoch > self.config.train.num_epochs_static_embedding:
50 for param_group in optimizer.param_groups[:2]:
51 param_group["lr"] = self.config.optimizer.learning_rate
52 else:
53 for param_group in optimizer.param_groups[:2]:
54 param_group["lr"] = 0
55
56 def forward(self, batch):
57 if self.config.feature.feature_names[0] == "token":

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected