Views
No views yet
input_dim = 28quantiles = [0.1, 0.5, 0.9]d_model = 128num_layers = 8num_heads = 8dim_feedforward = 512dropout = 0.1(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 |
ireneiele/agrimatnet-vegetation-forecasting1from agrimatnet.model_quantile import AgriMatNetQuantile
2
3model = AgriMatNetQuantile.from_pretrained("ireneiele/agrimatnet-vegetation-forecasting")
4model.eval()1from agrimatnet.model_quantile import AgriMatNetQuantile
2
3model = AgriMatNetQuantile.from_pretrained("./agrimatnet-hf")
4model.eval().pth checkpoint1import torch
2from agrimatnet.model_quantile import AgriMatNetQuantile
3
4model = AgriMatNetQuantile(
5 input_dim=28,
6 quantiles=[0.1, 0.5, 0.9],
7 d_model=128,
8 num_layers=8,
9 num_heads=8,
10 dim_feedforward=512,
11 dropout=0.1,
12)
13
14checkpoint = torch.load("checkpoint_best.pth", map_location="cpu")
15state_dict = checkpoint.get("model_state_dict", checkpoint)
16model.load_state_dict(state_dict)
17model.eval()historyfuturehistory_maskfuture_maskhistory_pad_maskfuture_pad_maskfuture_target_positions1import torch
2from torch.utils.data import DataLoader
3
4from agrimatnet.model_quantile import AgriMatNetQuantile
5from agrimatnet.train_quantile_ablation import collate_variable
6from dataset_builder.torch_dataset import CacheTimeSeriesDataset
7
8dataset = CacheTimeSeriesDataset(
9 cache_dir="timeSeries/cache/<split>",
10 apply_scaling=True,
11 feature_engineering=True,
12 discretize_target=False,
13)
14
15loader = DataLoader(
16 dataset,
17 batch_size=4,
18 shuffle=False,
19 collate_fn=collate_variable,
20)
21
22model = AgriMatNetQuantile.from_pretrained("ireneiele/agrimatnet-vegetation-forecasting")
23model.eval()
24
25batch = next(iter(loader))
26with torch.no_grad():
27 preds = model(batch)
28
29print(preds.shape) # (B, T, 3)
30print(dataset.feature_names)