-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_from_2.py
More file actions
34 lines (26 loc) · 808 Bytes
/
create_from_2.py
File metadata and controls
34 lines (26 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import neuralforecast as nf
import neuralforecast.losses.pytorch as nflp
import pandas as pd
import numpy as np
from stdlib.qname import import_from, create_from
NF_LOSSES = {
None: nflp.MSE,
"mae": nflp.MAE,
"mse": nflp.MSE,
"rmse": nflp.RMSE,
"mape": nflp.MAPE,
"smape": nflp.SMAPE,
"mase": nflp.MASE,
"relmse": nflp.relMSE,
"quatileloss": nflp.QuantileLoss,
"mqloss": nflp.MQLoss,
"huberloss": nflp.HuberLoss,
"huberqloss": nflp.HuberQLoss,
"hubermqloss": nflp.HuberMQLoss,
"distributionloss": nflp.DistributionLoss
}
print(create_from("mse", aliases=NF_LOSSES))
print(create_from(dict(
clazz="distributionloss",
distribution="StudentT", level=[80, 90], return_params=False
), aliases=NF_LOSSES))