620d2c767c309327aa04210192b08f1c1fd0de76,reagent/models/dqn.py,FullyConnectedDQN,forward,#FullyConnectedDQN#Any#,44

Before Change


        return rlt.PreprocessedState.from_tensor(torch.randn(1, self.state_dim))

    def forward(self, input: rlt.PreprocessedState):
        q_values = self.fc(input.state.float_features)
        return rlt.AllActionQValues(q_values=q_values)


class _DistributedDataParallelFullyConnectedDQN(ModelBase):

After Change


            return self.feature_extractor.input_prototype()
        return rlt.PreprocessedState.from_tensor(torch.randn(1, self.input_dim()))

    def forward(self, input) -> rlt.AllActionQValues:
        q_values = self.dist(input).q_values
        if self.quantiles > 1:
            q_values = q_values.reshape((-1, self.action_dim, self.quantiles)).mean(
                dim=2
            )
        return rlt.AllActionQValues(q_values=q_values)

    def dist(self, input: rlt.PreprocessedState) -> rlt.AllActionQValues:
        if self.feature_extractor is not None:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: facebookresearch/Horizon
Commit Name: 620d2c767c309327aa04210192b08f1c1fd0de76
Time: 2020-04-28
Author: jjg@fb.com
File Name: reagent/models/dqn.py
Class Name: FullyConnectedDQN
Method Name: forward


Project Name: facebookresearch/Horizon
Commit Name: 620d2c767c309327aa04210192b08f1c1fd0de76
Time: 2020-04-28
Author: jjg@fb.com
File Name: reagent/models/dqn.py
Class Name: FullyConnectedDQN
Method Name: forward


Project Name: deepchem/deepchem
Commit Name: f766c92a63fb67a99744dcb82c8c78406fbf905a
Time: 2020-11-04
Author: mufeili1996@gmail.com
File Name: deepchem/models/torch_models/gat.py
Class Name: GAT
Method Name: forward


Project Name: deepchem/deepchem
Commit Name: 97d7f88df32ae58875d7534c7c517905a3eb1341
Time: 2020-11-05
Author: mufeili1996@gmail.com
File Name: deepchem/models/torch_models/gat.py
Class Name: GAT
Method Name: forward