MCPcopy Create free account
hub / github.com/rlcode/reinforcement-learning / __init__

Method __init__

2-cartpole/2-a2c.py:36–41  ·  view source on GitHub ↗
(self, state_size, action_size)

Source from the content-addressed store, hash-verified

34# Policy network: outputs logits over actions.
35class Actor(nn.Module):
36 def __init__(self, state_size, action_size):
37 super().__init__()
38 self.fc1 = nn.Linear(state_size, 24)
39 self.fc2 = nn.Linear(24, action_size)
40 nn.init.kaiming_uniform_(self.fc1.weight, nonlinearity="relu")
41 nn.init.kaiming_uniform_(self.fc2.weight, nonlinearity="relu")
42
43 def forward(self, x):
44 return self.fc2(torch.relu(self.fc1(x)))

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected