MCPcopy Create free account
hub / github.com/pytorch/examples / __init__

Method __init__

reinforcement_learning/actor_critic.py:40–52  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected