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

Policy Gradient Issue: ValueError: Shapes (20, 1) and (20, 2) are incompatible #27

Open
danisch-khurshid-creator opened this issue May 21, 2020 · 1 comment

Comments

@danisch-khurshid-creator
Copy link

danisch-khurshid-creator commented May 21, 2020

Hi.
The code Code is not working with this line: loss = network.train_on_batch(states, discounted_rewards).

@asokraju
Copy link

Try this... it should work...
target_actions = np.array([[1 if a==i else 0 for i in range(2)] for a in actions]) loss = network.train_on_batch(states,target_actions, sample_weight=discounted_rewards)

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