Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AdvRL19
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flgw
AdvRL19
Commits
c73e1782
Commit
c73e1782
authored
Mar 27, 2019
by
Florian Gawrilowicz
Browse files
Options
Downloads
Patches
Plain Diff
pepify & adapt path
parent
bbfefa09
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
hw1/load_policy.py
+9
-4
9 additions, 4 deletions
hw1/load_policy.py
with
9 additions
and
4 deletions
hw1/load_policy.py
+
9
−
4
View file @
c73e1782
import
pickle
,
tensorflow
as
tf
,
tf_util
,
numpy
as
np
import
pickle
import
tensorflow
as
tf
import
numpy
as
np
from
.
import
tf_util
def
load_policy
(
filename
):
with
open
(
filename
,
'
rb
'
)
as
f
:
...
...
@@ -35,7 +39,8 @@ def load_policy(filename):
obsnorm_meansq
=
policy_params
[
'
obsnorm
'
][
'
Standardizer
'
][
'
meansq_1_D
'
]
obsnorm_stdev
=
np
.
sqrt
(
np
.
maximum
(
0
,
obsnorm_meansq
-
np
.
square
(
obsnorm_mean
)))
print
(
'
obs
'
,
obsnorm_mean
.
shape
,
obsnorm_stdev
.
shape
)
normedobs_bo
=
(
obs_bo
-
obsnorm_mean
)
/
(
obsnorm_stdev
+
1e-6
)
# 1e-6 constant from Standardizer class in nn.py:409 in openai/imitation
normedobs_bo
=
(
obs_bo
-
obsnorm_mean
)
/
(
obsnorm_stdev
+
1e-6
)
# 1e-6 constant from Standardizer class in nn.py:409 in openai/imitation
curr_activations_bd
=
normedobs_bo
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment