Skip to content

Commit

Permalink
Clean-up: Removed unused variables and fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
jan1854 committed Mar 30, 2024
1 parent deabd7f commit de80349
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 0 additions & 2 deletions sbx/common/jax_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ def __call__(self, x, use_running_average: Optional[bool] = None):
custom_mean = mean
custom_var = var
if not self.is_initializing():
r = jnp.array(1.0)
d = jnp.array(0.0)
std = jnp.sqrt(var + self.epsilon)
ra_std = jnp.sqrt(ra_var.value + self.epsilon)
# scale
Expand Down
4 changes: 1 addition & 3 deletions sbx/crossq/crossq.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def train(self, gradient_steps: int, batch_size: int) -> None:
(actor_loss_value, qf_loss_value, ent_coef_value),
) = self._train(
self.gamma,
self.tau,
self.target_entropy,
gradient_steps,
data,
Expand Down Expand Up @@ -260,7 +259,7 @@ def mse_loss(
#
# This has two reasons:
# 1. According to the paper obs/actions and next_obs/next_state_actions are differently
# distributed which is the reason why "naively" appling Batch Normalization in SAC fails.
# distributed which is the reason why "naively" applying Batch Normalization in SAC fails.
# The batch statistics have to instead be calculated for the mixture distribution of obs/next_obs
# and actions/next_state_actions. Otherwise, next_obs/next_state_actions are perceived as
# out-of-distribution to the Batch Normalization layer, since running statistics are only polyak averaged
Expand Down Expand Up @@ -385,7 +384,6 @@ def update_actor_and_temperature(
def _train(
cls,
gamma: float,
tau: float,
target_entropy: ArrayLike,
gradient_steps: int,
data: ReplayBufferSamplesNp,
Expand Down

0 comments on commit de80349

Please sign in to comment.