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

enable_save_figure() has no detailed document, and its comment is wrong. #688

Closed
Tracked by #548
shenpengfii opened this issue Jul 18, 2023 · 4 comments
Closed
Tracked by #548
Labels
discussion Discussion of a typical issue env Questions about RL environment

Comments

@shenpengfii
Copy link

shenpengfii commented Jul 18, 2023

The official document does offer any information for enable_save_figure(), one of the interfaces from the class BaseEnvManager. It interrupted when I want a simple method to display the reward-episode chart, but I have to go for the raw code:

def enable_save_figure(self, env_id: int, figure_path: Union[List[str], str]) -> None:
        """
        Overview:
            Set each env's replay save path.
        Arguments:
            - replay_path (:obj:`Union[List[str], str]`): List of paths for each environment; \
                Or one path for all environments.
        """
        if isinstance(figure_path, str):
            self._env[env_id].enable_save_figure(figure_path)
        else:
            raise TypeError("invalid figure_path arguments type: {}".format(type(figure_path)))

Then I found the comment of Arguments distinguished with itself. It seems the comment is the same as the method enable_save_replay(), shown as follow:

def enable_save_replay(self, replay_path: Union[List[str], str]) -> None:
        """
        Overview:
            Set each env's replay save path.
        Arguments:
            - replay_path (:obj:`Union[List[str], str]`): List of paths for each environment; \
                Or one path for all environments.
        """
        if isinstance(replay_path, str):
            replay_path = [replay_path] * self.env_num
        self._env_replay_path = replay_path

And I want to know where to learn the function of enable_save_figure()? Is it a method for showing the rewards chart?

@PaParaZz1 PaParaZz1 added discussion Discussion of a typical issue env Questions about RL environment labels Jul 18, 2023
@PaParaZz1
Copy link
Member

Thanks for your feedback. I have fixed this problem in this commit (49f2e20). And you can refer to this environment for the specific example of this method.

@shenpengfii
Copy link
Author

shenpengfii commented Jul 18, 2023 via email

@shenpengfii
Copy link
Author

shenpengfii commented Jul 19, 2023

How can I confirm the parameter env_id of enable_save_figure()?

@shenpengfii shenpengfii reopened this Jul 19, 2023
@PaParaZz1
Copy link
Member

How can I confirm the parameter env_id of enable_save_figure()?

You can refer to the code implementation here. If you have other demands, you can modify evaluator to implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion of a typical issue env Questions about RL environment
Projects
None yet
Development

No branches or pull requests

2 participants