7130245fb45db86263963fe237b40ce1f5b06c73,model/sentiment_classifier.py,MultiLayerBinaryClassifier,forward,#MultiLayerBinaryClassifier#Any#,106

Before Change


        print("init MultiLayerBinaryClassifier with layers %s and dropout %s" % (self.layer_sizes, self.dropout))

    def forward(self, X, **kwargs):
        return (self.model(X).float())

    // HACK -- parameter to measure *variation* between last layer of the MLP.
    // Why? To support multihead -- for the same category, where we want multiple heads to predict with different functions
    // (similar to training a mixture of models) -- useful for uncertainty sampling

After Change


        clf_out = self.model(X).float()
        if self.heads_per_class <= 1:
            return clf_out
        clf_out = clf_out.view(clf_out.size(0), -1, self.heads_per_class)
        probs = clf_out
        if self.softmax:
            probs = F.softmax(probs, 1)
        clf_mean = probs.mean(dim=2)
        clf_std = probs.std(dim=2)
        return clf_out, clf_mean, clf_std

    // HACK -- parameter to measure *variation* between last layer of the MLP.
    // Why? To support multihead -- for the same category, where we want multiple heads to predict with different functions
    // (similar to training a mixture of models) -- useful for uncertainty sampling
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 6

Non-data size: 7

Instances


Project Name: NVIDIA/sentiment-discovery
Commit Name: 7130245fb45db86263963fe237b40ce1f5b06c73
Time: 2018-11-28
Author: raulp@nvidia.com
File Name: model/sentiment_classifier.py
Class Name: MultiLayerBinaryClassifier
Method Name: forward


Project Name: KaiyangZhou/deep-person-reid
Commit Name: 4ce9024fcc64d7f98ac5441921c33131306e3186
Time: 2018-10-27
Author: k.zhou@qmul.ac.uk
File Name: torchreid/models/inceptionv4.py
Class Name: InceptionV4Base
Method Name: forward


Project Name: arraiy/torchgeometry
Commit Name: 766bd71d6cca7313988b02784be6d56834e8c744
Time: 2020-10-19
Author: sj8716643@126.com
File Name: kornia/filters/filter.py
Class Name:
Method Name: filter2D


Project Name: arraiy/torchgeometry
Commit Name: 766bd71d6cca7313988b02784be6d56834e8c744
Time: 2020-10-19
Author: sj8716643@126.com
File Name: kornia/filters/filter.py
Class Name:
Method Name: filter3D


Project Name: ruotianluo/ImageCaptioning.pytorch
Commit Name: c8fadd2d970f1c62ae8a842464056263f8d1232f
Time: 2017-02-13
Author: rluo@ttic.edu
File Name: resnet.py
Class Name: myResnet
Method Name: forward