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

Implementation: Logical error #9

Open
KornbergFresnel opened this issue Jan 26, 2018 · 0 comments
Open

Implementation: Logical error #9

KornbergFresnel opened this issue Jan 26, 2018 · 0 comments

Comments

@KornbergFresnel
Copy link

KornbergFresnel commented Jan 26, 2018

s_batch,a_batch,r_batch,d_batch,s2_batch = replayMemory.miniBatch(int(args['minibatch_size']))
a = []
for j in range(env.n):
	state_batch_j = np.asarray([x for x in s_batch[:,j]])
	a.append(actors[j].predict_target(state_batch_j))

	a_temp = np.transpose(np.asarray(a),(1,0,2))
	a_for_critic = np.asarray([x.flatten() for x in a_temp])
	s2_batch_i = np.asarray([x for x in s2_batch[:,i]])
	targetQ = critic.predict_target(s2_batch_i,a_for_critic)  # maybe a bug

targetQ should be calculated with s2_batch and a_next (a_next is predicted with s2_batch), while you use s_batch to get the a_for_critic to compute targetQ, so I think there has a logic error in your implementation.

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