(self)
| 38 | implements both actor and critic in one model |
| 39 | """ |
| 40 | def __init__(self): |
| 41 | super(Policy, self).__init__() |
| 42 | self.affine1 = nn.Linear(4, 128) |
| 43 | |
| 44 | # actor's layer |
| 45 | self.action_head = nn.Linear(128, 2) |
| 46 | |
| 47 | # critic's layer |
| 48 | self.value_head = nn.Linear(128, 1) |
| 49 | |
| 50 | # action & reward buffer |
| 51 | self.saved_actions = [] |
| 52 | self.rewards = [] |
| 53 | |
| 54 | def forward(self, x): |
| 55 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected