Skip to content

Commit

Permalink
Added more models. Fixed number of actions
Browse files Browse the repository at this point in the history
  • Loading branch information
quajak committed Apr 18, 2024
1 parent 0523043 commit b500fb6
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 2 deletions.
Binary file added models/trained/Freeway/1713396710_Predictor.pth
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added models/trained/Pong/1713396916_feat_extract.pth
Binary file not shown.
2 changes: 1 addition & 1 deletion src/model/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, input_size: int = 128, hidden_size: int = 32, output_size: in
self.transformer_encoder = nn.TransformerEncoder(encoder_layers, num_layers)
self.time_mlp = nn.Sequential(nn.Linear(output_size, output_size))
self.pred_mlp = nn.Sequential(nn.Linear(output_size, output_size), nn.ReLU(), nn.Linear(output_size, 2))
self.action_embedding = nn.Embedding(16, embed_dim)
self.action_embedding = nn.Embedding(18, embed_dim)
self.embedding = nn.Sequential(nn.Linear(output_size+embed_dim, output_size), nn.ReLU())

def forward(self, x: torch.Tensor, curr_pos: torch.Tensor, actions: torch.Tensor) -> torch.Tensor: # pylint: disable = unused-argument
Expand Down
2 changes: 1 addition & 1 deletion src/model/predictor_baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def __init__(self, input_size: int = 128, time_steps: int = 5, embed_dim: int =
self.encoder = nn.Sequential(nn.Linear(input_size, input_size), nn.ReLU(), nn.Linear(input_size, input_size))
self.next_state = nn.Sequential(nn.Linear(input_size, input_size), nn.ReLU(), nn.Linear(input_size, input_size))
self.output = nn.Sequential(nn.Linear(input_size, input_size), nn.ReLU(), nn.Linear(input_size, 2))
self.action_embedding = nn.Embedding(16, embed_dim)
self.action_embedding = nn.Embedding(18, embed_dim)
self.embedding = nn.Sequential(nn.Linear(input_size+embed_dim, input_size), nn.ReLU())

def forward(self, x: torch.Tensor, curr_pos: torch.Tensor, actions: torch.Tensor) -> torch.Tensor:
Expand Down

0 comments on commit b500fb6

Please sign in to comment.