Probabilistic NDVI Forecasting from Sparse Satellite Time Series and Weather Covariates
Paper • 2602.17683 • Published • 1
This model has been pushed to the Hub using the PyTorchModelHubMixin integration:
input_dim = 28quantiles = [0.1, 0.5, 0.9]d_model = 128num_layers = 8num_heads = 8dim_feedforward = 512dropout = 0.1The model outputs a tensor with shape (batch_size, forecast_horizon, 3).
| Item | Meaning | How to get it |
|---|---|---|
input_dim |
Number of feature columns expected by the model | len(dataset.feature_names) |
feature_names |
Exact feature order used by the cache | dataset.feature_names |
| Historical target | Stored in the last feature column | Enforced by the cache pipeline |
batch |
Dictionary passed to forward() |
collate_variable(...) from the training script |
Do not reorder columns manually. The checkpoint was trained with the cache feature order exactly as produced by the repository pipeline.
Hugging Face repository id: ireneiele/agrimatnet-vegetation-forecasting
from agrimatnet.model_quantile import AgriMatNetQuantile
model = AgriMatNetQuantile.from_pretrained("ireneiele/agrimatnet-vegetation-forecasting")
model.eval()
from agrimatnet.model_quantile import AgriMatNetQuantile
model = AgriMatNetQuantile.from_pretrained("./agrimatnet-hf")
model.eval()
.pth checkpoint
Use this path if you are loading a training checkpoint produced by the repository scripts.
import torch
from agrimatnet.model_quantile import AgriMatNetQuantile
model = AgriMatNetQuantile(
input_dim=28,
quantiles=[0.1, 0.5, 0.9],
d_model=128,
num_layers=8,
num_heads=8,
dim_feedforward=512,
dropout=0.1,
)
checkpoint = torch.load("checkpoint_best.pth", map_location="cpu")
state_dict = checkpoint.get("model_state_dict", checkpoint)
model.load_state_dict(state_dict)
model.eval()
The forward pass expects a dictionary with the same structure produced by the dataset pipeline:
historyfuturehistory_maskfuture_maskhistory_pad_maskfuture_pad_maskfuture_target_positionsThe feature order must match the training cache exactly. The historical target is kept in the last feature column.
import torch
from torch.utils.data import DataLoader
from agrimatnet.model_quantile import AgriMatNetQuantile
from agrimatnet.train_quantile_ablation import collate_variable
from dataset_builder.torch_dataset import CacheTimeSeriesDataset
dataset = CacheTimeSeriesDataset(
cache_dir="timeSeries/cache/<split>",
apply_scaling=True,
feature_engineering=True,
discretize_target=False,
)
loader = DataLoader(
dataset,
batch_size=4,
shuffle=False,
collate_fn=collate_variable,
)
model = AgriMatNetQuantile.from_pretrained("ireneiele/agrimatnet-vegetation-forecasting")
model.eval()
batch = next(iter(loader))
with torch.no_grad():
preds = model(batch)
print(preds.shape) # (B, T, 3)
print(dataset.feature_names)