Skip to content

Commit

Permalink
Merge pull request #56 from yhs0602/patch-1
Browse files Browse the repository at this point in the history
Bug fix for NGU module's AttributeError
  • Loading branch information
yuanmingqi authored Jan 4, 2025
2 parents eeefded + 18183b2 commit 0bd71ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rllte/xplore/reward/ngu.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def __init__(
weight_init=weight_init,
)

self.mrs = mrs

super().__init__(*[rnd, pseudo_counts])

def compute(self, samples: Dict[str, th.Tensor], sync: bool = True) -> th.Tensor:
Expand All @@ -145,4 +147,4 @@ def compute(self, samples: Dict[str, th.Tensor], sync: bool = True) -> th.Tensor
lifelong_rewards, th.ones_like(lifelong_rewards) * self.mrs
)

return lifelong_rewards * episodic_rewards
return lifelong_rewards * episodic_rewards

0 comments on commit 0bd71ec

Please sign in to comment.