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 think there are some small bugs in your code. #1

Open
ZYunfeii opened this issue Jul 27, 2021 · 0 comments
Open

I think there are some small bugs in your code. #1

ZYunfeii opened this issue Jul 27, 2021 · 0 comments

Comments

@ZYunfeii
Copy link

In train.py, your code is as follows:

PART II hindsight replay

for i, transition in enumerate(episode_cache):
    new_goals = generate_goals(i, episode_cache, args.HER_sample_num)
    for new_goal in new_goals:
        reward = calcu_reward(new_goal, state, action) 
        state, action, new_state = gene_new_sas(new_goal, transition)
        ram.add(state, action, reward, new_state)

But I think it should be like that:

PART II hindsight replay

for i, transition in enumerate(episode_cache):
    new_goals = generate_goals(i, episode_cache, args.HER_sample_num)
    for new_goal in new_goals:
        state = transition[0]
        action = transition[1]
        reward = calcu_reward(new_goal, state, action) 
        state, action, new_state = gene_new_sas(new_goal, transition) # 一个transition被换成了各种goals
        ram.add(state, action, reward, new_state)

Otherwise, this algorithm is not convergent. I have tried to train 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