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

Some possible optimization #5

Open
vedmathai opened this issue Jul 27, 2018 · 1 comment
Open

Some possible optimization #5

vedmathai opened this issue Jul 27, 2018 · 1 comment

Comments

@vedmathai
Copy link

I may be wrong but doesn't
mini_batch.append(self.memory.popleft())
do better job than
mini_batch.append(self.memory[i])
in

def expReplay(self, batch_size):
	mini_batch = []
	l = len(self.memory)
	for i in xrange(l - batch_size + 1, l):
                 mini_batch.append(self.memory[i])

It is much faster too.

@rockmany2000
Copy link

Vedmathai , Your code is very different from the original code.
popleft() will remove data from queue . then len(agent.memory) will be 0 . then 1 train / step will become 1 train / 32 steps.
The episode loop will become quick , but I don't know what the result will happen.

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