Example #1
0
 def __iadd__(self, other):
     if isinstance(other, WeightSet):
         nn.iadd(self.mem, other.mem)
         return self
     else:
         nn.iadd(self.mem, other)
         return self
Example #2
0
 def fprop(self, H_prev, w, b, H, dH):
     if H_prev.ndim == 2:
         H_temp = H_prev
     else:
         H_temp = H_prev.reshape(H_prev.shape[0], -1)
     # print 'hey',H_temp.shape,w.shape,H.shape
     nn.dot(H_temp, w, H)
     nn.iadd(H, b)
     # print H.shape,H
     self.activation(H, H, dH)
     return H, dH
 def fprop(self, H_prev, w, b, H, dH):
     if H_prev.ndim==2:
         H_temp = H_prev                    
     else: 
         H_temp = H_prev.reshape(H_prev.shape[0], -1) 
     # print 'hey',H_temp.shape,w.shape,H.shape
     nn.dot(H_temp,w,H)
     nn.iadd(H,b)
     # print H.shape,H
     self.activation(H,H,dH)  
     return H,dH               
Example #4
0
 def __iadd__(self, other):
     if isinstance(other, WeightSet): nn.iadd(self.mem,other.mem); return self
     else: nn.iadd(self.mem,other); return self