Downloads · 30 days
8
7% of all-time downloads
ireneiele/agrimatnet-vegetation-forecasting
agrimatnet-vegetation-forecasting is a machine learning model from ireneiele. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This model has been pushed to the Hub using the PyTorchModelHubMixin integration: - Code: https://github.com/arco-group/ndvi-forecasting - Paper: https://arxiv.org/abs/2602.17683 - Docs: See the usage examples below.
Downloads · 30 days
8
7% of all-time downloads
All-time downloads
108
Public
Parameters
4.5M
18 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors18 MB · 100%
From the Hugging Face model README
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 checkpointUse 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)