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

feat: support safe slac #324

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

feat: support safe slac #324

wants to merge 3 commits into from

Conversation

Gaiejj
Copy link
Member

@Gaiejj Gaiejj commented Apr 17, 2024

Description

This PR is already complete in terms of implementation accuracy. We will merge it shortly after improving the code style and documentation.

Support Safe SLAC[1] algorithms for Safe Vision tasks in Safety-Gymnasium

[1]: Safe Reinforcement Learning From Pixels Using a Stochastic Latent Representation

Example Demo

safe_slac.mp4

Experiment and Performance

  • SafetyCarGoal1Vision-v1
    SafetyCarGoal1---SafeSLAC
  • SafetyPointButton1Vision-v1
    SafetyPointButton1---SafeSLAC
  • SafetyPointGoal1Vision-v1
    SafetyPointGoal1---SafeSLAC
  • SafetyPointGoal2Vision-v1
    SafetyPointGoal2---SafeSLAC

Motivation and Context

Vision-based safety tasks are of great significance for the safe exploration of agents. The interface for Safe Vision will promote the development of vision-based SafeRL algorithms.

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds core functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • I have read the CONTRIBUTION guide. (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly. (required for a bug fix or a new feature)
  • I have updated the documentation accordingly.
  • I have reformatted the code using make format. (required)
  • I have checked the code using make lint. (required)
  • I have ensured make test pass. (required)

Copy link

codecov bot commented Apr 17, 2024

Codecov Report

Attention: Patch coverage is 27.43056% with 418 lines in your changes are missing coverage. Please review.

Project coverage is 91.63%. Comparing base (93d4975) to head (9fd5fd7).
Report is 1 commits behind head on main.

❗ Current head 9fd5fd7 differs from pull request most recent head 277b6e1. Consider uploading reports for the commit 277b6e1 to get more accurate results

Files Patch % Lines
omnisafe/common/latent.py 20.92% 121 Missing ⚠️
omnisafe/algorithms/off_policy/safe_slac.py 19.67% 98 Missing ⚠️
omnisafe/adapter/offpolicy_latent_adapter.py 24.39% 93 Missing ⚠️
omnisafe/common/buffer/offpolicy_buffer.py 33.33% 26 Missing ⚠️
omnisafe/utils/tools.py 35.00% 26 Missing ⚠️
omnisafe/envs/safety_gymnasium_vision_env.py 46.67% 24 Missing ⚠️
omnisafe/utils/model.py 40.74% 16 Missing ⚠️
omnisafe/common/buffer/base.py 39.13% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #324      +/-   ##
==========================================
- Coverage   96.83%   91.63%   -5.21%     
==========================================
  Files         138      142       +4     
  Lines        7071     7643     +572     
==========================================
+ Hits         6847     7003     +156     
- Misses        224      640     +416     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

None yet

1 participant