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

Method __init__

1-grid-world/6-reinforce.py:33–41  ·  view source on GitHub ↗
(self, state_size, action_size)

Source from the content-addressed store, hash-verified

31# Softmax is applied where we need probabilities (sampling / log-prob).
32class PolicyNetwork(nn.Module):
33 def __init__(self, state_size, action_size):
34 super().__init__()
35 self.net = nn.Sequential(
36 nn.Linear(state_size, 24),
37 nn.ReLU(),
38 nn.Linear(24, 24),
39 nn.ReLU(),
40 nn.Linear(24, action_size),
41 )
42
43 def forward(self, x):
44 return self.net(x)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected