(self, params, cost)
| 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 | |
| 78 | class SGDSimple(Update): |
nothing calls this directly
no test coverage detected