예제 #1
0
 def forward(self):
     self.cache = softmax(self.x.data)
     return Tensor(-self.y.data * np.log(self.cache + 1e-7))
예제 #2
0
파일: log.py 프로젝트: argocan/plautodiff
 def forward(self):
     return Tensor(log(self.x.data), diff=self.diff)
예제 #3
0
 def forward(self):
     return Tensor(add(self.x.data, self.y.data), diff=self.diff)
예제 #4
0
 def forward(self):
     self.cache = softmax(self.x.data)
     return Tensor(np.log(self.cache + 1e-7), diff=self.diff)
예제 #5
0
 def cast_to_tensor(x: Union[float, Tensor]):
     if type(x) is float:
         x = Tensor(x)
     return x
예제 #6
0
 def forward(self):
     return Tensor(forward(self.x.data, self.p), diff=self.diff)
예제 #7
0
 def forward(self):
     self.cache = np.exp(self.x.data)
     return Tensor(self.cache, diff=self.diff)
예제 #8
0
 def forward(self):
     self.cache = softmax(self.x.data)
     return Tensor(self.cache, diff=self.diff)