7d7dd54986ddc6218acf2db119b287f68111e15a,thinc/loss.py,SequenceCategoricalCrossentropy,__call__,#SequenceCategoricalCrossentropy#Any#Any#,144
Before Change
def __call__(
self, guesses: List[Floats2d], truths: List[Union[Ints1d, Floats2d]]
) -> Tuple[List[Floats2d], float]:
return self.get_grad(guesses, truths), self.get_loss(guesses, truths)
def get_grad(
self, guesses: List[Floats2d], truths: List[Union[Ints1d, Floats2d]]
) -> List[Floats2d]:
After Change
def __call__(
self, guesses: List[Floats2d], truths: List[Union[Ints1d, Floats2d]]
) -> Tuple[List[Floats2d], float]:
grads = self.get_grad(guesses, truths)
loss = self._get_loss_from_grad(grads)
return grads, loss
def get_grad(
self, guesses: List[Floats2d], truths: List[Union[Ints1d, Floats2d]]
) -> List[Floats2d]:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: explosion/thinc
Commit Name: 7d7dd54986ddc6218acf2db119b287f68111e15a
Time: 2020-05-14
Author: honnibal+gh@gmail.com
File Name: thinc/loss.py
Class Name: SequenceCategoricalCrossentropy
Method Name: __call__
Project Name: explosion/thinc
Commit Name: 7d7dd54986ddc6218acf2db119b287f68111e15a
Time: 2020-05-14
Author: honnibal+gh@gmail.com
File Name: thinc/loss.py
Class Name: SequenceCategoricalCrossentropy
Method Name: get_loss
Project Name: explosion/thinc
Commit Name: ee8819aa148805c3f9ea4b8e4568dada985cd28b
Time: 2020-05-09
Author: honnibal+gh@gmail.com
File Name: thinc/loss.py
Class Name: CategoricalCrossentropy
Method Name: __call__