Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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