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

An confusion about sample #463

Open
guest-oo opened this issue Dec 18, 2024 · 0 comments
Open

An confusion about sample #463

guest-oo opened this issue Dec 18, 2024 · 0 comments

Comments

@guest-oo
Copy link

def sample(self, batch_size: int) -> Tuple[TEN, TEN, TEN, TEN, TEN, TEN]:
    ids = th.randint(self.cur_size - 1, size=(batch_size,), requires_grad=False)
    return (
        self.states[ids],
        self.actions[ids],
        self.rewards[ids],
        self.undones[ids],
        self.unmasks[ids],
        self.states[ids + 1],
    )   

Is this not a good way to deal with it? I think other people use dictionaries to deal with it。

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

1 participant