Commit d381a5d8 authored by Yuxin Wu's avatar Yuxin Wu

bug fix

parent 77c8bde9
...@@ -24,8 +24,7 @@ My Batch-A3C implementation only took <2 hours. ...@@ -24,8 +24,7 @@ My Batch-A3C implementation only took <2 hours.
Both were trained on one GPU with an extra GPU for simulation. Both were trained on one GPU with an extra GPU for simulation.
The x-axis is the number of iterations, not wall time. The x-axis is the number of iterations, not wall time.
Iteration speed on Tesla M40 is about 9.7it/s for B-A3C. D-DQN is faster at the beginning but will converge to 12 batches/s (768 frames/s) due of exploration annealing.
D-DQN is faster at the beginning but will converge to 12it/s due of exploration annealing.
## How to use ## How to use
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# Author: Yuxin Wu <ppwwyyxxc@gmail.com> # Author: Yuxin Wu <ppwwyyxxc@gmail.com>
import tensorflow as tf import tensorflow as tf
from contextlib import contextmanager
from .gradproc import apply_grad_processors as apply_gradproc from .gradproc import apply_grad_processors as apply_gradproc
__all__ = ['apply_grad_processors', 'ProxyOptimizer', __all__ = ['apply_grad_processors', 'ProxyOptimizer',
...@@ -86,6 +87,7 @@ class PostProcessVariablesOptimizer(ProxyOptimizer): ...@@ -86,6 +87,7 @@ class PostProcessVariablesOptimizer(ProxyOptimizer):
update_op = tf.group(update_op, *ops, name=name) update_op = tf.group(update_op, *ops, name=name)
return update_op return update_op
@contextmanager
def _maybe_colocate(self, var): def _maybe_colocate(self, var):
G = tf.get_default_graph() G = tf.get_default_graph()
if self._colocate: if self._colocate:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment