Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
lli
YM-Seminar
Commits
bb7d426f
Commit
bb7d426f
authored
Apr 27, 2021
by
lli
Browse files
corrected output neurons in reinforce
parent
bcd483ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
algorithms/reinforce.py
View file @
bb7d426f
...
...
@@ -10,7 +10,6 @@ class PolicyNetwork(nn.Module):
def
__init__
(
self
,
n_state
,
n_hidden
,
n_action
,
lr
):
'''
Initialize the policy neural network:
Use one hidden layer
Input: a state, followed by a hidden layer
Output: the probability of taking possible individual actions
use softmax function as the activation for the output layer
...
...
@@ -22,7 +21,7 @@ class PolicyNetwork(nn.Module):
nn
.
ReLU
(),
nn
.
Linear
(
n_hidden
,
n_hidden
),
nn
.
ReLU
(),
nn
.
Linear
(
n_hidden
,
n_
hidde
n
),
nn
.
Linear
(
n_hidden
,
n_
actio
n
),
nn
.
Softmax
(
dim
=-
1
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment