Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
2ad739ad
Commit
2ad739ad
authored
Nov 25, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python3 fix in RL/simulator
parent
491e0cd9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
examples/GAN/GAN.py
examples/GAN/GAN.py
+4
-3
tensorpack/RL/simulator.py
tensorpack/RL/simulator.py
+2
-1
No files found.
examples/GAN/GAN.py
View file @
2ad739ad
...
@@ -25,12 +25,13 @@ class GANTrainer(QueueInputTrainerBase):
...
@@ -25,12 +25,13 @@ class GANTrainer(QueueInputTrainerBase):
with
TowerContext
(
''
):
with
TowerContext
(
''
):
actual_inputs
=
self
.
_get_input_tensors_noreuse
()
actual_inputs
=
self
.
_get_input_tensors_noreuse
()
self
.
model
.
build_graph
(
actual_inputs
)
self
.
model
.
build_graph
(
actual_inputs
)
self
.
gs_incr
=
tf
.
assign_add
(
get_global_step_var
(),
1
,
name
=
'global_step_incr'
)
self
.
g_min
=
self
.
config
.
optimizer
.
minimize
(
self
.
model
.
g_loss
,
self
.
g_min
=
self
.
config
.
optimizer
.
minimize
(
self
.
model
.
g_loss
,
var_list
=
self
.
model
.
g_vars
,
name
=
'g_op'
)
var_list
=
self
.
model
.
g_vars
,
name
=
'g_op'
)
self
.
d_min
=
self
.
config
.
optimizer
.
minimize
(
self
.
model
.
d_loss
,
self
.
d_min
=
self
.
config
.
optimizer
.
minimize
(
self
.
model
.
d_loss
,
var_list
=
self
.
model
.
d_vars
)
var_list
=
self
.
model
.
d_vars
,
name
=
'd_op'
)
self
.
d_min
=
tf
.
group
(
self
.
d_min
,
summary_moving_average
(),
name
=
'd_op'
)
self
.
gs_incr
=
tf
.
assign_add
(
get_global_step_var
(),
1
,
name
=
'global_step_incr'
)
self
.
summary_op
=
summary_moving_average
()
self
.
d_min
=
tf
.
group
(
self
.
d_min
,
self
.
summary_op
)
def
run_step
(
self
):
def
run_step
(
self
):
for
_
in
range
(
self
.
_opt_g
):
for
_
in
range
(
self
.
_opt_g
):
...
...
tensorpack/RL/simulator.py
View file @
2ad739ad
...
@@ -49,7 +49,8 @@ class SimulatorProcessBase(mp.Process):
...
@@ -49,7 +49,8 @@ class SimulatorProcessBase(mp.Process):
def
__init__
(
self
,
idx
):
def
__init__
(
self
,
idx
):
super
(
SimulatorProcessBase
,
self
)
.
__init__
()
super
(
SimulatorProcessBase
,
self
)
.
__init__
()
self
.
idx
=
int
(
idx
)
self
.
idx
=
int
(
idx
)
self
.
name
=
self
.
identity
=
u'simulator-{}'
.
format
(
self
.
idx
)
.
encode
(
'utf-8'
)
self
.
name
=
u'simulator-{}'
.
format
(
self
.
idx
)
self
.
identity
=
self
.
name
.
encode
(
'utf-8'
)
@
abstractmethod
@
abstractmethod
def
_build_player
(
self
):
def
_build_player
(
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