Unable to append state and action tensors to a list

I am developing a simple model based rl algorithms which takes in a state and action as input and outputs the next state

Please find my code here.

My issue is with the following block of code –


preds_array.append(torch.max(preds, 1)[1].unsqueeze(0)) next_state_array.append(next_state_tensor) # Calculate the loss and the accuracy loss = loss_fn(preds, next_state_tensor) if episode%50==0 and episode!=0: print(“next_state_array = “, next_state_array) print(“Length = “, len(preds_array))


For some reason, my `preds_array` and `next_state_array`, only contains a single element. I have spent multiple hours debugging and also asked ChatGPT for help, but can’t figure out what the issue is.

Please let me know if any clarification is required.

submitted by /u/Academic-Rent7800
[link] [comments]

Leave a Reply

The Future Is A.I. !
To top