5618ab9c3d550a0bd4112f6c0b76f657ee220703,thinc/loss.py,SequenceCategoricalCrossentropy,get_grad,#SequenceCategoricalCrossentropy#,151

Before Change


        err = "Cannot calculate SequenceCategoricalCrossentropy loss: guesses and truths must be same length"
        if len(guesses) != len(truths):  // pragma: no cover
            raise ValueError(err)
        n = sum(yh.shape[0] for yh in guesses)
        d_scores = []
        for yh, y in zip(guesses, truths):
            d_yh = self.cc.get_grad(yh, y)
            if self.normalize:

After Change


        err = "Cannot calculate SequenceCategoricalCrossentropy loss: guesses and truths must be same length"
        if len(guesses) != len(truths):  // pragma: no cover
            raise ValueError(err)
        n = len(guesses)
        d_scores = []
        for yh, y in zip(guesses, truths):
            d_yh = self.cc.get_grad(yh, y)
            if self.normalize:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: explosion/thinc
Commit Name: 5618ab9c3d550a0bd4112f6c0b76f657ee220703
Time: 2020-07-07
Author: honnibal+gh@gmail.com
File Name: thinc/loss.py
Class Name: SequenceCategoricalCrossentropy
Method Name: get_grad


Project Name: craffel/mir_eval
Commit Name: a490a1e41a8d3a4547fa0a46e12cf0584431e520
Time: 2014-04-17
Author: brm2132@columbia.edu
File Name: mir_eval/structure.py
Class Name:
Method Name: pairwise


Project Name: dask/dask-image
Commit Name: cbbcea8795e8da754a5b3ffb1a08ef66afd84eef
Time: 2018-09-02
Author: jakirkham@gmail.com
File Name: dask_image/ndmeasure/_utils.py
Class Name:
Method Name: _ravel_shape_indices