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

Method __init__

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

Source from the content-addressed store, hash-verified

47# Value network: outputs a scalar V(s).
48class Critic(nn.Module):
49 def __init__(self, state_size):
50 super().__init__()
51 self.fc1 = nn.Linear(state_size, 24)
52 self.fc2 = nn.Linear(24, 1)
53 nn.init.kaiming_uniform_(self.fc1.weight, nonlinearity="relu")
54 nn.init.kaiming_uniform_(self.fc2.weight, nonlinearity="relu")
55
56 def forward(self, x):
57 return self.fc2(torch.relu(self.fc1(x))).squeeze(-1)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected