Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed reward description of PointMaze dense environments #253

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

HridayM25
Copy link
Contributor

Description

Fixed error in the reward description of the PointMaze env.

Type of change

Please delete options that are not relevant.

  • Documentation only change (no code changed)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@Kallinteris-Andreas Kallinteris-Andreas changed the title Fixed reward description Fixed reward description of PointMaze dense environments Oct 30, 2024
Copy link
Collaborator

@Kallinteris-Andreas Kallinteris-Andreas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reference:

def compute_reward(
self, achieved_goal: np.ndarray, desired_goal: np.ndarray, info
) -> float:
distance = np.linalg.norm(achieved_goal - desired_goal, axis=-1)
if self.reward_type == "dense":
return np.exp(-distance)
elif self.reward_type == "sparse":
return (distance <= 0.45).astype(np.float64)

@Kallinteris-Andreas Kallinteris-Andreas merged commit 4eec964 into Farama-Foundation:main Oct 30, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants