Skip to content

Commit

Permalink
DOFA: fix bug in patch embedding
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart committed Aug 27, 2024
1 parent 27a981c commit e5cbb06
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions torchgeo/models/dofa.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@ def forward(self, x: Tensor, wavelengths: Tensor) -> tuple[Tensor, Tensor]:
weight, bias = self.weight_generator(waves) # 3x3x3

dynamic_weight = weight.view(
self.embed_dim, inplanes, self.kernel_size, self.kernel_size
) # 3xoutdx16x16
inplanes, self.kernel_size, self.kernel_size, self.embed_dim
)
dynamic_weight = dynamic_weight.permute([3, 0, 1, 2])

if bias is not None:
bias = bias.view([self.embed_dim]) * self.scaler

Expand Down

0 comments on commit e5cbb06

Please sign in to comment.