e37a3673f57936713fea57581962937ce096e1a0,reagent/evaluation/seq2reward_evaluator.py,Seq2RewardEvaluator,evaluate,#Seq2RewardEvaluator#Any#,21

Before Change


        detached_loss = loss.cpu().detach().item()

        if self.trainer.view_q_value:
            q_values = (
                get_Q(
                    self.trainer.seq2reward_network, eval_batch, self.trainer.all_permut
                )
                .cpu()
                .mean(0)
                .tolist()
            )
        else:
            q_values = [0] * len(self.trainer.params.action_names)

        self.reward_net.train(reward_net_prev_mode)

After Change


            minlength=len(self.trainer.params.action_names),
        )
        // normalize
        action_distribution = (
            action_distribution.float() / torch.sum(action_distribution)
        ).tolist()

        self.reward_net.train(reward_net_prev_mode)
        return (detached_loss, q_values, action_distribution)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: facebookresearch/Horizon
Commit Name: e37a3673f57936713fea57581962937ce096e1a0
Time: 2020-10-14
Author: czxttkl@fb.com
File Name: reagent/evaluation/seq2reward_evaluator.py
Class Name: Seq2RewardEvaluator
Method Name: evaluate


Project Name: SPFlow/SPFlow
Commit Name: 57d5ab96afe665f5e4c98e3af674d28b4b7fa547
Time: 2018-06-14
Author: molina@cs.tu-darmstadt.de
File Name: src/spn/experiments/RandomSPNs/LearnRGSPN.py
Class Name:
Method Name: Make_SPN_from_RegionGraph


Project Name: tensorflow/tensorboard
Commit Name: 898584dfc3a17d5cd7f8bad5e1e7990364f1e07d
Time: 2017-09-15
Author: zeng.chi@gmail.com
File Name: tensorboard/plugins/pr_curve/pr_curves_plugin.py
Class Name: PrCurvesPlugin
Method Name: _process_tensor_event