MCPcopy Index your code
hub / github.com/CompVis/diff2flow / configure_optimizers

Method configure_optimizers

diff2flow/trainer_module.py:185–192  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

183 pass
184
185 def configure_optimizers(self):
186 opt = torch.optim.Adam(self.parameters(), lr=self.lr, weight_decay=self.weight_decay)
187 out = dict(optimizer=opt)
188 if exists(self.lr_scheduler_cfg):
189 sch = load_partial_from_config(self.lr_scheduler_cfg)
190 sch = sch(optimizer=opt)
191 out["lr_scheduler"] = sch
192 return out
193
194 def forward(self, x1: Tensor, x0: Tensor, **kwargs):
195 return self.model.training_losses(x1=x1, x0=x0, **kwargs).mean()

Callers

nothing calls this directly

Calls 2

existsFunction · 0.90
load_partial_from_configFunction · 0.90

Tested by

no test coverage detected