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
13530934
baselines
Commits
902ffcb7
Commit
902ffcb7
authored
Aug 28, 2017
by
John Schulman
Committed by
GitHub
Aug 28, 2017
Browse files
Merge pull request #120 from hamzamerzic/tensorflow_global_variable
Deprecated VARIABLES -> GLOBAL_VARIABLES.
parents
4e2a570e
a7320b80
Changes
3
Show whitespace changes
Inline
Side-by-side
baselines/ppo1/cnn_policy.py
View file @
902ffcb7
...
@@ -49,7 +49,7 @@ class CnnPolicy(object):
...
@@ -49,7 +49,7 @@ class CnnPolicy(object):
ac1
,
vpred1
=
self
.
_act
(
stochastic
,
ob
[
None
])
ac1
,
vpred1
=
self
.
_act
(
stochastic
,
ob
[
None
])
return
ac1
[
0
],
vpred1
[
0
]
return
ac1
[
0
],
vpred1
[
0
]
def
get_variables
(
self
):
def
get_variables
(
self
):
return
tf
.
get_collection
(
tf
.
GraphKeys
.
VARIABLES
,
self
.
scope
)
return
tf
.
get_collection
(
tf
.
GraphKeys
.
GLOBAL_
VARIABLES
,
self
.
scope
)
def
get_trainable_variables
(
self
):
def
get_trainable_variables
(
self
):
return
tf
.
get_collection
(
tf
.
GraphKeys
.
TRAINABLE_VARIABLES
,
self
.
scope
)
return
tf
.
get_collection
(
tf
.
GraphKeys
.
TRAINABLE_VARIABLES
,
self
.
scope
)
def
get_initial_state
(
self
):
def
get_initial_state
(
self
):
...
...
baselines/ppo1/mlp_policy.py
View file @
902ffcb7
...
@@ -51,7 +51,7 @@ class MlpPolicy(object):
...
@@ -51,7 +51,7 @@ class MlpPolicy(object):
ac1
,
vpred1
=
self
.
_act
(
stochastic
,
ob
[
None
])
ac1
,
vpred1
=
self
.
_act
(
stochastic
,
ob
[
None
])
return
ac1
[
0
],
vpred1
[
0
]
return
ac1
[
0
],
vpred1
[
0
]
def
get_variables
(
self
):
def
get_variables
(
self
):
return
tf
.
get_collection
(
tf
.
GraphKeys
.
VARIABLES
,
self
.
scope
)
return
tf
.
get_collection
(
tf
.
GraphKeys
.
GLOBAL_
VARIABLES
,
self
.
scope
)
def
get_trainable_variables
(
self
):
def
get_trainable_variables
(
self
):
return
tf
.
get_collection
(
tf
.
GraphKeys
.
TRAINABLE_VARIABLES
,
self
.
scope
)
return
tf
.
get_collection
(
tf
.
GraphKeys
.
TRAINABLE_VARIABLES
,
self
.
scope
)
def
get_initial_state
(
self
):
def
get_initial_state
(
self
):
...
...
baselines/trpo_mpi/nosharing_cnn_policy.py
View file @
902ffcb7
...
@@ -49,7 +49,7 @@ class CnnPolicy(object):
...
@@ -49,7 +49,7 @@ class CnnPolicy(object):
ac1
,
vpred1
=
self
.
_act
(
stochastic
,
ob
[
None
])
ac1
,
vpred1
=
self
.
_act
(
stochastic
,
ob
[
None
])
return
ac1
[
0
],
vpred1
[
0
]
return
ac1
[
0
],
vpred1
[
0
]
def
get_variables
(
self
):
def
get_variables
(
self
):
return
tf
.
get_collection
(
tf
.
GraphKeys
.
VARIABLES
,
self
.
scope
)
return
tf
.
get_collection
(
tf
.
GraphKeys
.
GLOBAL_
VARIABLES
,
self
.
scope
)
def
get_trainable_variables
(
self
):
def
get_trainable_variables
(
self
):
return
tf
.
get_collection
(
tf
.
GraphKeys
.
TRAINABLE_VARIABLES
,
self
.
scope
)
return
tf
.
get_collection
(
tf
.
GraphKeys
.
TRAINABLE_VARIABLES
,
self
.
scope
)
def
get_initial_state
(
self
):
def
get_initial_state
(
self
):
...
...
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