86aca57545cfe312151cc35528035cd9c0aafe2d,art/classifiers/pytorch.py,PyTorchClassifier,predict,#PyTorchClassifier#Any#Any#,48

Before Change


        // Run prediction
        preds = self._forward_at(torch.from_numpy(inputs), self._logit_layer).detach().numpy()
        if not logits:
            exp = np.exp(preds - np.max(preds, axis=1, keepdims=True))
            preds = exp / np.sum(exp, axis=1, keepdims=True)

        return preds

After Change


        if logits:
            preds = logit_output.detach().numpy()
        else:
            preds = output.detach().numpy()

        return preds

    def fit(self, inputs, outputs, batch_size=128, nb_epochs=10):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 86aca57545cfe312151cc35528035cd9c0aafe2d
Time: 2018-05-17
Author: M.N.Tran@ibm.com
File Name: art/classifiers/pytorch.py
Class Name: PyTorchClassifier
Method Name: predict


Project Name: rusty1s/pytorch_geometric
Commit Name: 075a7a98d0dd84aeee8eca0e199697d0f4729f3c
Time: 2019-11-22
Author: klicpera@in.tum.de
File Name: torch_geometric/transforms/gdc.py
Class Name: GDC
Method Name: _expm


Project Name: facebookresearch/Horizon
Commit Name: 69ee52aff61b9cda3d4ac874ab8b38ba0269c4c5
Time: 2020-07-17
Author: czxttkl@fb.com
File Name: reagent/training/ranking/seq2slate_trainer.py
Class Name: Seq2SlateTrainer
Method Name: train