MCPcopy
hub / github.com/junyanz/iGAN / __call__

Method __call__

lib/updates.py:66–75  ·  view source on GitHub ↗
(self, params, cost)

Source from the content-addressed store, hash-verified

64 self.__dict__.update(locals())
65
66 def __call__(self, params, cost):
67 updates = []
68 grads = T.grad(cost, params)
69 grads = clip_norms(grads, self.clipnorm)
70 for p, g in zip(params, grads):
71 g = self.regularizer.gradient_regularize(p, g)
72 updated_p = p - self.lr * g
73 updated_p = self.regularizer.weight_regularize(updated_p)
74 updates.append((p, updated_p))
75 return updates
76
77
78class SGDSimple(Update):

Callers

nothing calls this directly

Calls 3

clip_normsFunction · 0.85
gradient_regularizeMethod · 0.80
weight_regularizeMethod · 0.80

Tested by

no test coverage detected