e79449afe45f4da6f1756a7d92bdd3cd6618c638,qanta/guesser/dan.py,DanGuesser,_guess_batch,#DanGuesser#,434

Before Change



        out = self.model(input_dict, lengths_dict, qnums)
        probs = [p for p in F.softmax(out).data.cpu().numpy()]
        logits = [l for l in out.data.cpu().numpy()]
        preds = [np.argsort(-l)[:10] for l in logits]
        guesses = []
        for i, ps in enumerate(preds):
            guesses.append([])

After Change


        out = self.model(input_dict, lengths_dict, qnums)
        probs = F.softmax(out).data.cpu().numpy()
        n_examples = probs.shape[0]
        preds = np.argsort(-probs, axis=1)
        for i in range(n_examples):
            guesses.append([])
            for p in preds[i][:max_n_guesses]:
                guesses[-1].append((self.i_to_ans[p], probs[i][p]))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: Pinafore/qb
Commit Name: e79449afe45f4da6f1756a7d92bdd3cd6618c638
Time: 2018-04-25
Author: sjtufs@gmail.com
File Name: qanta/guesser/dan.py
Class Name: DanGuesser
Method Name: _guess_batch


Project Name: BVLC/caffe
Commit Name: 32dc03f14c36d1df46f37a7d13ad528e52c6f786
Time: 2015-11-05
Author: matthieu.perrinel@gmail.com
File Name: python/caffe/io.py
Class Name: Transformer
Method Name: deprocess


Project Name: maxpumperla/deep_learning_and_the_game_of_go
Commit Name: a17ac3677d207e04a53ed70fa971fbf436c0266f
Time: 2020-04-08
Author: 41198454+JingOY0610@users.noreply.github.com
File Name: code/dlgo/agent/alphago.py
Class Name: AlphaGoMCTS
Method Name: policy_rollout