Ejemplo n.º 1
0
 def bprop(self):
     if self.lhs_bprop:
         tmp = ca.equal(self.lhs.out, self.out)
         ca.multiply(self.out_grad, tmp, self.lhs.out_grad)
     if self.rhs_bprop:
         ca.equal(self.rhs.out, self.out, self.rhs.out_grad)
         self.rhs.out_grad *= self.out_grad
Ejemplo n.º 2
0
 def bprop(self):
     if self.lhs.bpropable:
         tmp = ca.equal(self.lhs.array, self.array)
         ca.multiply(self.grad_array, tmp, self.lhs.grad_array)
     if self.rhs.bpropable:
         ca.equal(self.rhs.array, self.array, self.rhs.grad_array)
         self.rhs.grad_array *= self.grad_array
Ejemplo n.º 3
0
 def bprop(self):
     if self.lhs_bprop:
         tmp = ca.equal(self.lhs.out, self.out)
         ca.multiply(self.out_grad, tmp, self.lhs.out_grad)
     if self.rhs_bprop:
         ca.equal(self.rhs.out, self.out, self.rhs.out_grad)
         self.rhs.out_grad *= self.out_grad
Ejemplo n.º 4
0
 def bprop(self):
     if self.lhs.bpropable:
         tmp = ca.equal(self.lhs.array, self.array)
         ca.multiply(self.grad_array, tmp, self.lhs.grad_array)
     if self.rhs.bpropable:
         ca.equal(self.rhs.array, self.array, self.rhs.grad_array)
         self.rhs.grad_array *= self.grad_array
Ejemplo n.º 5
0
 def bprop(self):
     if self.lhs_bprop:
         ca.equal(self.lhs.out, self.out, self.lhs.out_grad)
         self.lhs.out_grad *= self.out_grad
     if self.rhs_bprop:
         ca.equal(self.rhs.out, self.out, self.rhs.out_grad)
         self.rhs.out_grad *= self.out_grad