Skip to content

Commit

Permalink
Change SQL._update_target to match SAC._update_target
Browse files Browse the repository at this point in the history
  • Loading branch information
hartikainen committed Feb 1, 2019
1 parent 9ec1910 commit 3e15d9f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions softlearning/algorithms/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,16 @@ def train(self):
initial_exploration_policy=initial_exploration_policy)

def _init_training(self):
self._update_target()
self._update_target(tau=1.0)

def _update_target(self, tau=None):
tau = tau or self._tau

def _update_target(self):
source_params = self._Q.get_weights()
target_params = self._Q_target.get_weights()

self._Q_target.set_weights([
(1 - self._tau) * target + self._tau * source
for target, source in zip(target_params, source_params)
tau * source + (1.0 - tau) * target
for source, target in zip(source_params, target_params)
])

def _do_training(self, iteration, batch):
Expand Down

0 comments on commit 3e15d9f

Please sign in to comment.