Ioana-Gidiuta commited on
Commit
906fafc
·
verified ·
1 Parent(s): d56573a

Create README.md

Browse files

# SwinGPSModel

## Model Class

```python
class SwinGPSModel(nn.Module):
def __init__(self, pretrained=True):
super(SwinGPSModel, self).__init__()
# Load the pretrained Swin Transformer
self.backbone = create_model('swin_tiny_patch4_window7_224', pretrained=pretrained)

# Get the number of features from the backbone
num_features = self.backbone.num_features
self.backbone.head = nn.Identity()

# Define the regression head
self.regression_head = nn.Sequential(
nn.AdaptiveAvgPool2d((1, 1)),
nn.Flatten(),
nn.Linear(num_features, 256),
nn.ReLU(),
nn.Linear(256, 2)
)

def forward(self, x):
# Forward pass through the backbone
features = self.backbone(x)
features = features.permute(0, 3, 1, 2)
return self.regression_head(features)
```

## How to Run
In the notebook Ensemble_model_2_traning.ipynb, replace the line:
```python
dataset_test = load_dataset("gydou/released_img")
```
with the proper location of the testing dataset.

## Training Dataset Statistics
```python
lat_std = 0.0006914493505038013
lon_std = 0.0006539239061573955
lat_mean = 39.9517411499467
lon_mean = -75.19143213125122
```

Files changed (1) hide show
  1. README.md +0 -0
README.md ADDED
File without changes