(self, params, cost)
| 61 | self.__dict__.update(locals()) |
| 62 | |
| 63 | def __call__(self, params, cost): |
| 64 | updates = [] |
| 65 | grads = T.grad(cost, params) |
| 66 | grads = clip_norms(grads, self.clipnorm) |
| 67 | for p,g in zip(params,grads): |
| 68 | g = self.regularizer.gradient_regularize(p, g) |
| 69 | updated_p = p - self.lr * g |
| 70 | updated_p = self.regularizer.weight_regularize(updated_p) |
| 71 | updates.append((p, updated_p)) |
| 72 | return updates |
| 73 | |
| 74 | class Momentum(Update): |
| 75 |
nothing calls this directly
no test coverage detected