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

Chapter3: a strange error when I run Listing 3.7 #25

Open
DemonsHunter opened this issue Feb 19, 2021 · 0 comments
Open

Chapter3: a strange error when I run Listing 3.7 #25

DemonsHunter opened this issue Feb 19, 2021 · 0 comments

Comments

@DemonsHunter
Copy link

In the Listing 3.7, we use both memory replay and target network to improve the stablility.

However, in the memory loop:

if len(replay) > batch_size:
minibatch = random.sample(replay, batch_size)
...
action_batch = torch.Tensor([a for (s1,a,r,s2,d) in minibatch])

The compiler tells me this error:

---> 42 action_batch = torch.Tensor([a for (s1,a,r,s2,d) in minibatch])
too many dimensions 'str'

I suppose that when we memory, the action is represented by a characteristic. There, nevertheless, corresponding number are needed.

So I propose to make a reverse action set to fill this transform.

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