MCPcopy Create free account
hub / github.com/PolymathicAI/AstroCLIP / configure_optimizers

Method configure_optimizers

astroclip/models/moco_v2.py:242–253  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

240 self.log_dict(log)
241
242 def configure_optimizers(self):
243 optimizer = torch.optim.SGD(
244 self.parameters(),
245 self.hparams.learning_rate,
246 momentum=self.hparams.momentum,
247 weight_decay=self.hparams.weight_decay,
248 )
249 scheduler = torch.optim.lr_scheduler.CosineAnnealingLR(
250 optimizer,
251 self.trainer.max_epochs,
252 )
253 return [optimizer], [scheduler]
254
255 @staticmethod
256 def add_model_specific_args(parent_parser):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected