I finally got it to work, but i’m not exactly sure why. Can someone explain?
I changed the way I calculated Loss. I also noticed that when I converted the action_list to a torch tensor, the model won’t learn.
From:
  action_list = torch.tensor(action_list, requires_grad = True)
  reward_list = torch.tensor(reward_list, requires_grad = True)       

  loss = -reward_list*action_list
  loss = torch.sum(loss)

To:
  reward_list = torch.tensor(reward_list)  
  loss = 0
  for r, logprob in zip(reward_list, action_list):
      loss += -r * logprob