a2d4c181f1aa7e49dd5e6bc02bde9a5048be6b54,ch07/lib/dqn_model.py,DQN,__init__,#DQN#Any#Any#Any#Any#,75
Before Change
def __init__(self, input_shape, n_actions, noisy_net=False, writer=None):
super(DQN, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(input_shape[0], 32, kernel_size=8, stride=4),
nn.ReLU(),
nn.Conv2d(32, 64, kernel_size=4, stride=2),
nn.ReLU(),
nn.Conv2d(64, 64, kernel_size=3, stride=1),
nn.ReLU()
)
OutLayer = NoisyLinear if noisy_net else nn.Linear
conv_out_size = self._get_conv_out(input_shape)
After Change
self.sigma_weight = nn.Parameter(torch.Tensor(out_features, in_features).fill_(sigma_init))
self.register_buffer("epsilon_input", torch.zeros(1, in_features))
self.register_buffer("epsilon_output", torch.zeros(out_features, 1))
if bias:
self.sigma_bias = nn.Parameter(torch.Tensor(out_features).fill_(sigma_init))
def forward(self, input):
torch.randn(self.epsilon_input.size(), out=self.epsilon_input)
torch.randn(self.epsilon_output.size(), out=self.epsilon_output)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: a2d4c181f1aa7e49dd5e6bc02bde9a5048be6b54
Time: 2017-10-28
Author: max.lapan@gmail.com
File Name: ch07/lib/dqn_model.py
Class Name: DQN
Method Name: __init__
Project Name: osmr/imgclsmob
Commit Name: b09aa5e617f2a61a4ec908ba297aa2b8ab8e0a12
Time: 2019-03-11
Author: osemery@gmail.com
File Name: pytorch/pytorchcv/models/others/oth_revnet2.py
Class Name: BasicBlockSub
Method Name: __init__
Project Name: HyperGAN/HyperGAN
Commit Name: cf1ec69f7c4290f9959b1d902d35ce6d72c48995
Time: 2020-08-22
Author: martyn@255bits.com
File Name: hypergan/train_hooks/adversarial_norm_train_hook.py
Class Name: AdversarialNormTrainHook
Method Name: __init__