Skip to content

Commit

Permalink
fix spectralgpt and minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
LeungTsang committed Oct 18, 2024
1 parent 959f9f0 commit e350183
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 4 additions & 1 deletion configs/encoder/ssl4eo_data2vec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ patch_size: 16
num_heads: 6
depth: 12
mlp_ratio: 4
init_values: 0.1
use_abs_pos_emb: False
use_shared_rel_pos_bias: True

input_bands:
optical:
Expand All @@ -32,4 +35,4 @@ output_layers:
- 7
- 11

output_dim: 384
output_dim: 384
2 changes: 1 addition & 1 deletion pangaea/datasets/hlsburnscars.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def __init__(

self.split_mapping = {
"train": "training",
"val": "validation",
"val": "training",
"test": "validation",
}

Expand Down
6 changes: 2 additions & 4 deletions pangaea/encoders/spectralgpt_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,12 @@ def forward(self, image: dict[str, torch.Tensor]) -> list[torch.Tensor]:
out = x
out = out.view(N, T, L, C).transpose(2, 3).flatten(1, 2)
out = (
out.permute(0, 2, 1)
.contiguous()
.view(
out.view(
x.shape[0],
-1,
self.input_size // self.patch_size,
self.input_size // self.patch_size,
)
).contiguous()
)
output.append(out)

Expand Down

0 comments on commit e350183

Please sign in to comment.