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

weird unpack #19

Open
shtse8 opened this issue Aug 8, 2020 · 0 comments
Open

weird unpack #19

shtse8 opened this issue Aug 8, 2020 · 0 comments

Comments

@shtse8
Copy link

shtse8 commented Aug 8, 2020

def unpack(traces):

def unpack(traces):
    """Returns states, actions, rewards, end_states, and a mask for episode boundaries given traces."""
    states = [t[0].state for t in traces]
    actions = [t[0].action for t in traces]
    rewards = [[e.reward for e in t] for t in traces]
    end_states = [t[-1].nextState for t in traces]
    not_done_mask = [[1 if n.nextState is not None else 0 for n in t] for t in traces]
    return states, actions, rewards, end_states, not_done_mask

For my understanding, unpack function should unpack the traces into separated list for every elements.
But from the code, says states, it only take the first state on every buffer. and ignore all others.
I don't understand why.

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