Skip to content

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

Description

@DemonsHunter

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions