Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gym/decision_transformer/models/decision_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def forward(self, states, actions, rewards, returns_to_go, timesteps, attention_
x = x.reshape(batch_size, seq_length, 3, self.hidden_size).permute(0, 2, 1, 3)

# get predictions
return_preds = self.predict_return(x[:,2]) # predict next return given state and action
state_preds = self.predict_state(x[:,2]) # predict next state given state and action
return_preds = self.predict_return(torch.cat((tensors=(x[:1], x[:,2]), dim=2)) # predict next return given state and action
state_preds = self.predict_state(torch.cat((tensors=(x[:1], x[:,2]), dim=2)) # predict next state given state and action
action_preds = self.predict_action(x[:,1]) # predict next action given state

return state_preds, action_preds, return_preds
Expand Down