Downloads · 30 days
0
cdurand95/nainuq
nainuq is a machine learning model from cdurand95. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as apache-2.0.
A PyTorch-based UNet model for rapid sea-ice forecasting in the Arctic. This model emulates high-fidelity sea ice simulations from NANUQ, enabling fast predictions of sea ice properties including volume, concentration…
Downloads · 30 days
0
Access
Public
Updated Jul 27, 2026
Repo size
23.1 MB
Likes
0
Public
Click a slice to open those files.
.ckpt23.1 MB · 100%
From the Hugging Face model README
A PyTorch-based UNet model for rapid sea-ice forecasting in the Arctic. This model emulates high-fidelity sea ice simulations from NANUQ, enabling fast predictions of sea ice properties including volume, concentration, and velocity and snow volume.
Model Architecture: UNet with optional Partial Convolution layers
Input Resolution: 128×128 grid cells
Prediction Variables: Sea ice volume (SIT), concentration (SIC), velocity (SIU/SIV), snow volume (SNT)
Forecast Horizon: Configurable (typically 10-120 timesteps)
Temporal Resolution: 1, 6, 12, or 24 hours
The model accepts multi-channel input tensors representing:
Total input channels: 17 or 12 (if no ocean inputs)
Input shape: (batch_size, in_channels, 128, 128)
Predictions of sea ice variables at each forecast timestep:
Output shape: (batch_size, out_channels, 128, 128)
The model was trained on:
pip install torch torchvision numpy
# Clone the repository
git clone https://github.com/nanuqhub/nainuq.git
cd nainuq
import torch
from layers.full_UNet import UNetModel
# Load the model
model = UNetModel(
in_channels=17, # 7 atmosphere + 5 ocean + 5 sea ice
out_channels=5, # sit, sic, siu, siv, snt
base_features=32
)
# Load weights
checkpoint = torch.load("checkpoint_epoch_100.pt", weights_only=True)
model.load_state_dict(checkpoint["state_dict"])
model.eval()
# Prepare input (batch_size=1, 17 channels, 128x128 grid)
x = torch.randn(1, 17, 128, 128)
# Make prediction
with torch.no_grad():
output = model(x) # Shape: (1, 5, 128, 128)
from inference.test_utils import Test
import argparse
# Configure inference
args = argparse.Namespace(
sea_ice_variables=['sit', 'sic', 'siu', 'siv', 'snt'],
use_ocean_as_forcings=True,
ocean_under=True,
k=120, # forecast horizon (timesteps)
timestep=1, # temporal resolution (hours)
n_cycle=100, # number of forecast cycles
frequency=24, # offset between cycles
post_processing=True,
save_pred=True,
noise=0.0,
noise_init=True,
ocean=True
)
# Initialize test class
test = Test(
args=args,
model=model,
use_ocean_as_forcings=True,
N_ocean=5,
N_under=2,
N_inputs=17,
N_outputs=5,
frequency=24,
post_processing=True,
ocean=True,
season="all",
k=120,
N_cycle=100,
save_pred=True,
timestep=1,
path_to_save="./results",
path_to_data="./data",
noise=0.0,
noise_init=True
)
# Run inference
fs, fs_pers, bias, predictions, truth = test.test_model()
The model configuration is stored in config.json:
{
"in_channels": 17,
"out_channels": 5,
"base_features": 32,
"lr": 1e-4,
"weight_decay": 1e-3,
"lambda_": 100.0
}
Results vary by:
For detailed metrics, see test results in the repository.
Optional physical post-processing enforces:
Enable with --post_processing True
If you use this model, please cite:
MIT - See LICENSE file for details
Contributions are welcome! Please:
For questions, bugs, or feature requests, please open an issue on GitHub: https://github.com/nanuqhub/nainuq/issues
Last Updated: 2024
Model Status: Active
Maintained By: Nanuq Hub