MCPcopy Create free account
hub / github.com/JunlinHan/DCLGAN / optimize_parameters

Method optimize_parameters

models/template_model.py:94–99  ·  view source on GitHub ↗

Update network weights; it will be called in every training iteration.

(self)

Source from the content-addressed store, hash-verified

92 self.loss_G.backward() # calculate gradients of network G w.r.t. loss_G
93
94 def optimize_parameters(self):
95 """Update network weights; it will be called in every training iteration."""
96 self.forward() # first call forward to calculate intermediate results
97 self.optimizer.zero_grad() # clear network G's existing gradients
98 self.backward() # calculate gradients for network G
99 self.optimizer.step() # update gradients for network G

Callers

nothing calls this directly

Calls 2

forwardMethod · 0.95
backwardMethod · 0.95

Tested by

no test coverage detected