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

Before Change


        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([])
            for p in ps:
                guesses[-1].append((self.i_to_ans[p], logits[i][p], probs[i][p]))

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]))
        return guesses
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: 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


Project Name: tensorflow/models
Commit Name: cce6c09b1c11350f135f07322855f5b9ab7f5b03
Time: 2019-03-06
Author: rodryeluno@hotmail.com
File Name: research/im2txt/im2txt/inference_utils/caption_generator.py
Class Name: CaptionGenerator
Method Name: beam_search