45496de13b7932d8ec860da06f14d113000803be,ml/rl/training/dqn_trainer.py,DQNTrainer,calculate_q_values,#DQNTrainer#Any#,94

Before Change


        return len(self._actions)

    def calculate_q_values(self, states):
        return self.q_network(states).detach()

    def get_max_q_values(self, states, possible_actions, double_q_learning):
        
        Used in Q-learning update.

After Change


        is_numpy = False
        if isinstance(states, np.ndarray):
            is_numpy = True
            states = torch.tensor(states).type(self.dtype)
        result = self.q_network(states).detach()
        if is_numpy:
            return result.cpu().numpy()
        else:
            return result

    def get_max_q_values(self, states, possible_actions, double_q_learning):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: facebookresearch/Horizon
Commit Name: 45496de13b7932d8ec860da06f14d113000803be
Time: 2018-08-29
Author: jjg@fb.com
File Name: ml/rl/training/dqn_trainer.py
Class Name: DQNTrainer
Method Name: calculate_q_values


Project Name: kengz/SLM-Lab
Commit Name: aa4ae658489c919dbca4141c7498b05ac0cac6d8
Time: 2019-05-25
Author: kengzwl@gmail.com
File Name: slm_lab/agent/__init__.py
Class Name: AgentSpace
Method Name: act


Project Name: mariogeiger/se3cnn
Commit Name: 1defe2d899bc19eea71359a8e5b48d2d5cfcfcc9
Time: 2017-08-08
Author: geiger.mario@gmail.com
File Name: se3_cnn/train/model.py
Class Name: Model
Method Name: evaluate


Project Name: interactiveaudiolab/nussl
Commit Name: 2ffbfa3a6bd3b8de8e21a762489346054dcd9ccc
Time: 2020-03-12
Author: prem@u.northwestern.edu
File Name: nussl/separation/deep/deep_mask_estimation.py
Class Name: DeepMaskEstimation
Method Name: extract_features