Last active
March 21, 2017 07:12
-
-
Save neale/1d62923c2d4c833b783b992ecdcaa9e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DQN(object): | |
def __init__(self, input, num_actions): | |
self.conv1 = nn.Conv2d(input, 32, 3, stride=2, padding=1) | |
self.conv2 = nn.Conv2d(input, 32, 3, stride=2, padding=1) | |
self.conv3 = nn.Conv2d(input, 32, 3, stride=2, padding=1) | |
self.linear = nn.Linear(256, num_actions) | |
""" initialize weights""" | |
def forward(self, inputs): | |
x = nn.elu(self.conv1(inputs)) | |
x = nn.elu(self.conv2(x)) | |
x = nn.elu(self.conv3(x)) | |
x = x.view(-1, 32 * 3 * 3) | |
return self.linear(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment