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

I need your help #28

Open
returnZeroMan opened this issue May 27, 2022 · 2 comments
Open

I need your help #28

returnZeroMan opened this issue May 27, 2022 · 2 comments

Comments

@returnZeroMan
Copy link

Thank you for your contribution, which is very helpful for my study, but I don't know how to use dictionary action space, can you provide a sample of DRL? Thank you very much!!!

@davidcotton
Copy link
Owner

Hey, thanks for the feedback, I'm glad its helpful.
You can use a Gym dict space for both actions or observations and it acts just like a python dictionary in that it allows you to compose a more complex representation, made up of other Gym space objects. For example you could:

class MultiDiscreteActionsD2DEnv(D2DEnv):
    def __init__(self, env_config=None) -> None:
        super().__init__(env_config)
        self.action_space = spaces.Dict({
            'due': spaces.MultiDiscrete([self.simulator.config.num_rbs, self.num_pwr_actions['due']]),
            'cue': spaces.Discrete(self.simulator.config.num_rbs * self.num_pwr_actions['cue']),
            'mbs': spaces.Discrete(self.simulator.config.num_rbs * self.num_pwr_actions['mbs']),
        })

which you can access like:

space = env.action_space['due']

to configure your neural nets in DRL or whatever optimisation method you are using.

Hopefully soon I'll get some time to put together an example repo to show how you can use RLLib with GymD2D, but for now hopefully this is enough to get you started.

@returnZeroMan
Copy link
Author

After reading your paper, I can't use SAC algorithm to realize it. Could you please provide your SAC algorithm? It is only for personal learning.

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

No branches or pull requests

2 participants