def grad(self, x): self.x[:] = x g, g_flat, output = tool.ff_grad(self.net, self.input, self.target) if self.rr: # g_flat is link to g tool.reg_grad(g, self.net, self.rr) return g_flat
def calc(self, net, input, target): g1, g2, output = tool.ff_grad(net, input, target) return g2, output
def grad(self, x): self.x[:] = x gr = tool.ff_grad(self.net, self.input, self.target)[1] return gr