├── test ├── core │ └── .typesafe ├── dataset │ └── .typesafe ├── mx │ ├── kernels │ │ └── .typesafe │ ├── trainer │ │ └── .typesafe │ ├── distribution │ │ ├── .typesafe │ │ └── test_lds_data │ │ │ ├── data_level_issm.json.gz │ │ │ ├── data_level_trend_issm.json.gz │ │ │ └── data_level_trend_weekly_seasonal_issm.json.gz │ ├── model │ │ ├── seq2seq │ │ │ ├── .typesafe │ │ │ └── __init__.py │ │ ├── gp_forecaster │ │ │ ├── .typesafe │ │ │ └── __init__.py │ │ ├── deepar │ │ │ └── __init__.py │ │ ├── gpvar │ │ │ └── __init__.py │ │ ├── lstnet │ │ │ └── __init__.py │ │ ├── tft │ │ │ └── __init__.py │ │ ├── tpp │ │ │ └── __init__.py │ │ ├── canonical │ │ │ └── __init__.py │ │ ├── deep_factor │ │ │ └── __init__.py │ │ ├── deepstate │ │ │ └── __init__.py │ │ ├── deepvar │ │ │ └── __init__.py │ │ ├── n_beats │ │ │ └── __init__.py │ │ ├── renewal │ │ │ └── __init__.py │ │ ├── transformer │ │ │ └── __init__.py │ │ ├── wavenet │ │ │ └── __init__.py │ │ ├── deepvar_hierarchical │ │ │ └── __init__.py │ │ └── simple_feedforward │ │ │ └── __init__.py │ ├── representation │ │ └── .typesafe │ ├── require-packages.txt │ └── block │ │ └── __init__.py ├── torch │ ├── require-packages.txt │ └── __init__.py ├── ext │ ├── naive_2 │ │ └── require-packages.txt │ ├── prophet │ │ └── require-packages.txt │ ├── rotbaum │ │ ├── require-packages.txt │ │ └── __init__.py │ ├── statsforecast │ │ └── require-packages.txt │ └── hierarchicalforecast │ │ └── require-packages.txt ├── shell │ └── require-packages.txt ├── nursery │ ├── autogluon_tabular │ │ └── require-packages.txt │ ├── sagemaker_sdk │ │ └── require-packages.txt │ └── anomaly_detection │ │ └── supervised_metrics │ │ └── require-packages.txt ├── __init__.py ├── model │ └── npts │ │ ├── __init__.py │ │ └── test_model.py ├── ev │ └── __init__.py └── time_feature │ ├── __init__.py │ └── common.py ├── src └── gluonts │ ├── core │ ├── py.typed │ └── __init__.py │ ├── nursery │ ├── .typeunsafe │ ├── tsbench │ │ ├── src │ │ │ ├── cli │ │ │ │ ├── py.typed │ │ │ │ ├── ensembles │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── _main.py │ │ │ │ ├── _main.py │ │ │ │ ├── evaluations │ │ │ │ │ ├── _main.py │ │ │ │ │ └── __init__.py │ │ │ │ ├── datasets │ │ │ │ │ ├── _main.py │ │ │ │ │ └── __init__.py │ │ │ │ ├── analysis │ │ │ │ │ ├── _main.py │ │ │ │ │ └── __init__.py │ │ │ │ ├── __init__.py │ │ │ │ └── utils │ │ │ │ │ └── __init__.py │ │ │ └── tsbench │ │ │ │ ├── py.typed │ │ │ │ ├── evaluations │ │ │ │ ├── __init__.py │ │ │ │ ├── training │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── logging.py │ │ │ │ ├── metrics │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── metric.py │ │ │ │ ├── tracking │ │ │ │ │ └── __init__.py │ │ │ │ └── aws │ │ │ │ │ └── __init__.py │ │ │ │ ├── gluonts │ │ │ │ ├── __init__.py │ │ │ │ └── callbacks │ │ │ │ │ └── __init__.py │ │ │ │ ├── analysis │ │ │ │ ├── surrogate │ │ │ │ │ └── __init__.py │ │ │ │ ├── tracking │ │ │ │ │ └── __init__.py │ │ │ │ ├── recommender │ │ │ │ │ └── __init__.py │ │ │ │ └── __init__.py │ │ │ │ ├── __init__.py │ │ │ │ ├── recommender │ │ │ │ ├── generator │ │ │ │ │ └── __init__.py │ │ │ │ └── utils │ │ │ │ │ └── __init__.py │ │ │ │ ├── surrogate │ │ │ │ ├── transformers │ │ │ │ │ └── __init__.py │ │ │ │ └── torch │ │ │ │ │ └── __init__.py │ │ │ │ ├── config │ │ │ │ ├── model │ │ │ │ │ └── __init__.py │ │ │ │ ├── dataset │ │ │ │ │ └── __init__.py │ │ │ │ └── __init__.py │ │ │ │ ├── utils │ │ │ │ ├── __init__.py │ │ │ │ └── latex.py │ │ │ │ └── constants.py │ │ ├── .dockerignore │ │ ├── configs │ │ │ ├── benchmark │ │ │ │ ├── classic │ │ │ │ │ ├── arima_highcpu.yaml │ │ │ │ │ ├── prophet_highmem.yaml │ │ │ │ │ ├── prophet.yaml │ │ │ │ │ ├── arima.yaml │ │ │ │ │ ├── ets.yaml │ │ │ │ │ ├── npts.yaml │ │ │ │ │ ├── stlar.yaml │ │ │ │ │ ├── theta.yaml │ │ │ │ │ └── seasonal_naive.yaml │ │ │ │ └── deep │ │ │ │ │ ├── deepar_highmem.yaml │ │ │ │ │ ├── nbeats_ultramem.yaml │ │ │ │ │ ├── nbeats_highmem.yaml │ │ │ │ │ ├── nbeats.yaml │ │ │ │ │ └── mqrnn.yaml │ │ │ └── analysis │ │ │ │ ├── ensembles.yaml │ │ │ │ ├── hyper_ensembles.yaml │ │ │ │ ├── ensemble_recommenders.yaml │ │ │ │ └── recommenders.yaml │ │ ├── package.json │ │ ├── .gitignore │ │ ├── Dockerfile │ │ └── bin │ │ │ └── build-container.sh │ ├── QRX-Wrapped-M5-Accuracy-Solution │ │ ├── 4. logs │ │ │ └── blank.txt │ │ ├── 5. models │ │ │ └── blank.txt │ │ ├── 1. document │ │ │ └── blank.txt │ │ ├── 2. data │ │ │ ├── processed │ │ │ │ └── blank.txt │ │ │ └── readme.txt │ │ └── 6. submission │ │ │ └── before_ensemble │ │ │ └── blank.txt │ ├── SCott │ │ ├── requirements.txt │ │ ├── examples │ │ │ └── images │ │ │ │ ├── readme_0.png │ │ │ │ └── readme_1.png │ │ ├── model │ │ │ ├── __init__.py │ │ │ ├── ar │ │ │ │ └── __init__.py │ │ │ └── lstm │ │ │ │ └── __init__.py │ │ ├── trainers │ │ │ └── __init__.py │ │ └── commands │ │ │ ├── run_traffic.sh │ │ │ ├── run_exrate.sh │ │ │ └── run_synthetic.sh │ ├── robust-mts-attack │ │ ├── NOTICE │ │ ├── attack_params │ │ │ ├── attack_config_traffic_4.json │ │ │ ├── attack_config_taxi_2.json │ │ │ ├── attack_config_wiki_9.json │ │ │ └── attack_config_electricity_3.json │ │ └── pts │ │ │ ├── dataset │ │ │ ├── __init__.py │ │ │ └── repository │ │ │ │ ├── __init__.py │ │ │ │ └── datasets.py │ │ │ ├── model │ │ │ ├── deepvar │ │ │ │ └── __init__.py │ │ │ ├── lstnet │ │ │ │ └── __init__.py │ │ │ ├── transformer │ │ │ │ └── __init__.py │ │ │ ├── transformer_tempflow │ │ │ │ └── __init__.py │ │ │ ├── __init__.py │ │ │ ├── n_beats │ │ │ │ └── __init__.py │ │ │ ├── deepar │ │ │ │ └── __init__.py │ │ │ ├── tempflow │ │ │ │ └── __init__.py │ │ │ ├── causal_deepar │ │ │ │ └── __init__.py │ │ │ ├── tft │ │ │ │ └── __init__.py │ │ │ ├── time_grad │ │ │ │ └── __init__.py │ │ │ └── simple_feedforward │ │ │ │ └── __init__.py │ │ │ ├── feature │ │ │ └── __init__.py │ │ │ ├── distributions │ │ │ └── __init__.py │ │ │ └── __init__.py │ ├── daf │ │ ├── requirements.txt │ │ ├── README.md │ │ ├── __init__.py │ │ ├── tslib │ │ │ ├── __init__.py │ │ │ ├── nn │ │ │ │ ├── __init__.py │ │ │ │ └── attention │ │ │ │ │ └── __init__.py │ │ │ ├── metrics │ │ │ │ └── __init__.py │ │ │ ├── engine │ │ │ │ └── __init__.py │ │ │ └── dataset │ │ │ │ └── __init__.py │ │ ├── estimator │ │ │ └── __init__.py │ │ ├── engine │ │ │ └── __init__.py │ │ └── network │ │ │ └── __init__.py │ ├── spliced_binned_pareto │ │ ├── figures │ │ │ ├── illustration.png │ │ │ ├── output_10_2.png │ │ │ └── output_6_9.png │ │ └── __init__.py │ ├── few_shot_prediction │ │ └── src │ │ │ └── meta │ │ │ ├── __init__.py │ │ │ ├── data │ │ │ └── __init__.py │ │ │ ├── vis │ │ │ └── __init__.py │ │ │ ├── common │ │ │ ├── __init__.py │ │ │ └── torch.py │ │ │ ├── models │ │ │ ├── EcDc │ │ │ │ ├── __init__.py │ │ │ │ └── components │ │ │ │ │ └── __init__.py │ │ │ └── __init__.py │ │ │ └── metrics │ │ │ └── __init__.py │ ├── temporal_hierarchical_forecasting │ │ ├── __init__.py │ │ ├── eval │ │ │ └── __init__.py │ │ ├── model │ │ │ ├── __init__.py │ │ │ └── cop_deepar │ │ │ │ └── __init__.py │ │ └── utils │ │ │ └── __init__.py │ ├── san │ │ └── __init__.py │ ├── __init__.py │ ├── anomaly_detection │ │ └── __init__.py │ ├── sagemaker_sdk │ │ └── __init__.py │ ├── glide │ │ └── sequential.py │ └── gmm_tpp │ │ └── README.md │ ├── ext │ ├── README.md │ ├── __init__.py │ ├── naive_2 │ │ └── __init__.py │ ├── prophet │ │ └── __init__.py │ └── rotbaum │ │ └── __init__.py │ ├── meta │ ├── __init__.py │ ├── colors.py │ └── cli.py │ ├── shell │ ├── __init__.py │ ├── sagemaker │ │ └── __init__.py │ └── exceptions.py │ ├── model │ ├── trivial │ │ └── __init__.py │ ├── npts │ │ └── __init__.py │ ├── seasonal_naive │ │ └── __init__.py │ └── seasonal_agg │ │ └── __init__.py │ ├── torch │ ├── model │ │ ├── __init__.py │ │ ├── lightning_util.py │ │ ├── tide │ │ │ └── __init__.py │ │ ├── lag_tst │ │ │ └── __init__.py │ │ ├── d_linear │ │ │ └── __init__.py │ │ ├── deepar │ │ │ └── __init__.py │ │ ├── wavenet │ │ │ └── __init__.py │ │ ├── i_transformer │ │ │ └── __init__.py │ │ ├── mqf2 │ │ │ └── __init__.py │ │ ├── patch_tst │ │ │ └── __init__.py │ │ ├── tft │ │ │ └── __init__.py │ │ ├── simple_feedforward │ │ │ └── __init__.py │ │ └── deep_npts │ │ │ └── __init__.py │ ├── prelude.py │ ├── modules │ │ ├── __init__.py │ │ └── lambda_layer.py │ └── component.py │ ├── __main__.py │ ├── dataset │ ├── schema │ │ └── __init__.py │ ├── repository │ │ └── __init__.py │ └── artificial │ │ └── __init__.py │ ├── mx │ ├── model │ │ ├── deepar │ │ │ └── __init__.py │ │ ├── gpvar │ │ │ └── __init__.py │ │ ├── lstnet │ │ │ └── __init__.py │ │ ├── deepstate │ │ │ └── __init__.py │ │ ├── deepvar │ │ │ └── __init__.py │ │ ├── canonical │ │ │ └── __init__.py │ │ ├── deep_factor │ │ │ └── __init__.py │ │ ├── transformer │ │ │ └── __init__.py │ │ ├── gp_forecaster │ │ │ └── __init__.py │ │ ├── renewal │ │ │ └── __init__.py │ │ ├── simple_feedforward │ │ │ └── __init__.py │ │ ├── tft │ │ │ └── __init__.py │ │ ├── __init__.py │ │ ├── wavenet │ │ │ └── __init__.py │ │ ├── n_beats │ │ │ └── __init__.py │ │ ├── tpp │ │ │ ├── deeptpp │ │ │ │ └── __init__.py │ │ │ └── __init__.py │ │ ├── seq2seq │ │ │ └── __init__.py │ │ ├── deepvar_hierarchical │ │ │ └── __init__.py │ │ └── forecast_generator.py │ ├── block │ │ └── __init__.py │ ├── prelude.py │ └── trainer │ │ └── __init__.py │ ├── json.pyi │ ├── __init__.py │ └── ev │ └── __init__.py ├── requirements ├── requirements-arrow.txt ├── requirements-extras-r.txt ├── requirements-extras-prophet.txt ├── requirements-articial-dataset.py ├── requirements-extras-autogluon.txt ├── requirements-extras-m-competitions.txt ├── requirements-extras-shell.txt ├── requirements-rotbaum.txt ├── requirements-extras-anomaly-evaluation.txt ├── requirements-extras-hierarchicalforecast.txt ├── requirements-extras-cpflows.txt ├── requirements-rotbaum-extra-methods.txt ├── requirements-mxnet.txt ├── requirements-extras-sagemaker-sdk.txt ├── requirements.txt ├── requirements-extras-statsforecast.txt ├── requirements-test.txt ├── requirements-docs.txt └── requirements-pytorch.txt ├── .gitattributes ├── docs ├── community │ └── contribute.rst ├── _static │ ├── 404.jpg │ ├── gluonts.ico │ ├── electricity-10w.png │ ├── forecast-distributions.png │ └── style.css ├── figures │ ├── Tweets_AMZN_data.png │ └── Tweets_AMZN_forecast.png ├── tutorials │ ├── advanced_topics │ │ └── index.md │ ├── data_manipulation │ │ └── index.md │ └── forecasting │ │ └── index.md ├── 404.rst ├── mdinclude.py └── index.rst ├── NOTICE ├── examples └── dockerfiles │ ├── Dockerfile │ ├── Dockerfile-gpu │ ├── Dockerfile.r │ ├── Dockerfile.gpu │ └── README.md ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.md │ └── bug_report.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── lints.yml │ ├── style_type_checks.yml │ ├── tests-prophet.yaml │ ├── tests.yml │ ├── pypi.yml │ ├── tests-nixtla.yaml │ ├── tests-xgboost.yaml │ ├── tests-torch.yml │ └── doctests.yaml ├── .dockerignore ├── CODE_OF_CONDUCT.md └── MANIFEST.in /test/core/.typesafe: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/dataset/.typesafe: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/gluonts/core/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mx/kernels/.typesafe: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mx/trainer/.typesafe: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/gluonts/nursery/.typeunsafe: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mx/distribution/.typesafe: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mx/model/seq2seq/.typesafe: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mx/representation/.typesafe: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mx/model/gp_forecaster/.typesafe: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mx/require-packages.txt: -------------------------------------------------------------------------------- 1 | mxnet 2 | -------------------------------------------------------------------------------- /test/torch/require-packages.txt: -------------------------------------------------------------------------------- 1 | torch 2 | -------------------------------------------------------------------------------- /requirements/requirements-arrow.txt: -------------------------------------------------------------------------------- 1 | pyarrow 2 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/cli/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/ext/naive_2/require-packages.txt: -------------------------------------------------------------------------------- 1 | statsmodels 2 | -------------------------------------------------------------------------------- /test/ext/prophet/require-packages.txt: -------------------------------------------------------------------------------- 1 | prophet 2 | -------------------------------------------------------------------------------- /test/ext/rotbaum/require-packages.txt: -------------------------------------------------------------------------------- 1 | xgboost 2 | -------------------------------------------------------------------------------- /requirements/requirements-extras-r.txt: -------------------------------------------------------------------------------- 1 | rpy2~=3.5,<3.6 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | src/gluonts/meta/_version.py export-subst 2 | -------------------------------------------------------------------------------- /requirements/requirements-extras-prophet.txt: -------------------------------------------------------------------------------- 1 | prophet~=1.0 2 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/.dockerignore: -------------------------------------------------------------------------------- 1 | .venv/ 2 | .git/ 3 | -------------------------------------------------------------------------------- /test/ext/statsforecast/require-packages.txt: -------------------------------------------------------------------------------- 1 | statsforecast 2 | -------------------------------------------------------------------------------- /requirements/requirements-articial-dataset.py: -------------------------------------------------------------------------------- 1 | holidays >= 0.9 2 | -------------------------------------------------------------------------------- /requirements/requirements-extras-autogluon.txt: -------------------------------------------------------------------------------- 1 | autogluon==0.2.0 2 | -------------------------------------------------------------------------------- /requirements/requirements-extras-m-competitions.txt: -------------------------------------------------------------------------------- 1 | statsmodels~=0.11 -------------------------------------------------------------------------------- /test/shell/require-packages.txt: -------------------------------------------------------------------------------- 1 | flask 2 | waitress 3 | requests 4 | -------------------------------------------------------------------------------- /docs/community/contribute.rst: -------------------------------------------------------------------------------- 1 | .. mdinclude:: ../../CONTRIBUTING.md 2 | -------------------------------------------------------------------------------- /src/gluonts/nursery/QRX-Wrapped-M5-Accuracy-Solution/4. logs/blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/gluonts/nursery/QRX-Wrapped-M5-Accuracy-Solution/5. models/blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/nursery/autogluon_tabular/require-packages.txt: -------------------------------------------------------------------------------- 1 | autogluon.tabular 2 | -------------------------------------------------------------------------------- /test/nursery/sagemaker_sdk/require-packages.txt: -------------------------------------------------------------------------------- 1 | sagemaker 2 | s3fs 3 | -------------------------------------------------------------------------------- /requirements/requirements-extras-shell.txt: -------------------------------------------------------------------------------- 1 | flask~=3.0 2 | waitress~=3.0.1 3 | -------------------------------------------------------------------------------- /src/gluonts/nursery/QRX-Wrapped-M5-Accuracy-Solution/1. document/blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requirements/requirements-rotbaum.txt: -------------------------------------------------------------------------------- 1 | xgboost>=0.90,<2 2 | scikit-learn~=1.0 3 | -------------------------------------------------------------------------------- /src/gluonts/nursery/QRX-Wrapped-M5-Accuracy-Solution/2. data/processed/blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/nursery/anomaly_detection/supervised_metrics/require-packages.txt: -------------------------------------------------------------------------------- 1 | sklearn 2 | -------------------------------------------------------------------------------- /docs/_static/404.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/gluonts/HEAD/docs/_static/404.jpg -------------------------------------------------------------------------------- /src/gluonts/nursery/QRX-Wrapped-M5-Accuracy-Solution/6. submission/before_ensemble/blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/ext/hierarchicalforecast/require-packages.txt: -------------------------------------------------------------------------------- 1 | statsforecast 2 | hierarchicalforecast 3 | -------------------------------------------------------------------------------- /requirements/requirements-extras-anomaly-evaluation.txt: -------------------------------------------------------------------------------- 1 | numba~=0.51,<0.54 2 | scikit-learn~=1.0 -------------------------------------------------------------------------------- /docs/_static/gluonts.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/gluonts/HEAD/docs/_static/gluonts.ico -------------------------------------------------------------------------------- /requirements/requirements-extras-hierarchicalforecast.txt: -------------------------------------------------------------------------------- 1 | statsforecast~=1.0 2 | hierarchicalforecast~=0.3 -------------------------------------------------------------------------------- /src/gluonts/nursery/SCott/requirements.txt: -------------------------------------------------------------------------------- 1 | pytorchts==0.2.0 2 | numpy 3 | torch>=1.5.0 4 | tensorboard 5 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Gluon Time Series 2 | Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /requirements/requirements-extras-cpflows.txt: -------------------------------------------------------------------------------- 1 | git+https://github.com/lostella/CP-Flow.git@gluonts-dependency 2 | -------------------------------------------------------------------------------- /docs/_static/electricity-10w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/gluonts/HEAD/docs/_static/electricity-10w.png -------------------------------------------------------------------------------- /docs/figures/Tweets_AMZN_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/gluonts/HEAD/docs/figures/Tweets_AMZN_data.png -------------------------------------------------------------------------------- /docs/figures/Tweets_AMZN_forecast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/gluonts/HEAD/docs/figures/Tweets_AMZN_forecast.png -------------------------------------------------------------------------------- /docs/_static/forecast-distributions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/gluonts/HEAD/docs/_static/forecast-distributions.png -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/NOTICE: -------------------------------------------------------------------------------- 1 | Gluon Time Series 2 | Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /src/gluonts/nursery/SCott/examples/images/readme_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/gluonts/HEAD/src/gluonts/nursery/SCott/examples/images/readme_0.png -------------------------------------------------------------------------------- /src/gluonts/nursery/SCott/examples/images/readme_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/gluonts/HEAD/src/gluonts/nursery/SCott/examples/images/readme_1.png -------------------------------------------------------------------------------- /test/mx/distribution/test_lds_data/data_level_issm.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/gluonts/HEAD/test/mx/distribution/test_lds_data/data_level_issm.json.gz -------------------------------------------------------------------------------- /requirements/requirements-rotbaum-extra-methods.txt: -------------------------------------------------------------------------------- 1 | lightgbm>=2.3.1 2 | # scikit-garden @ https://github.com/scikit-garden/scikit-garden/archive/refs/heads/master.zip 3 | -------------------------------------------------------------------------------- /docs/tutorials/advanced_topics/index.md: -------------------------------------------------------------------------------- 1 | # Advanced 2 | 3 | ```{toctree} 4 | :maxdepth: 1 5 | howto_pytorch_lightning 6 | hp_tuning_with_optuna 7 | trainer_callbacks 8 | ``` 9 | -------------------------------------------------------------------------------- /src/gluonts/nursery/daf/requirements.txt: -------------------------------------------------------------------------------- 1 | torch==2.2.0 2 | tensorboard==2.3.0 3 | numpy==1.22.0 4 | pandas==1.1.5 5 | scikit-learn~=1.5.0 6 | scipy==1.10.0 7 | matplotlib==3.3.2 -------------------------------------------------------------------------------- /src/gluonts/nursery/spliced_binned_pareto/figures/illustration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/gluonts/HEAD/src/gluonts/nursery/spliced_binned_pareto/figures/illustration.png -------------------------------------------------------------------------------- /src/gluonts/nursery/spliced_binned_pareto/figures/output_10_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/gluonts/HEAD/src/gluonts/nursery/spliced_binned_pareto/figures/output_10_2.png -------------------------------------------------------------------------------- /src/gluonts/nursery/spliced_binned_pareto/figures/output_6_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/gluonts/HEAD/src/gluonts/nursery/spliced_binned_pareto/figures/output_6_9.png -------------------------------------------------------------------------------- /test/mx/distribution/test_lds_data/data_level_trend_issm.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/gluonts/HEAD/test/mx/distribution/test_lds_data/data_level_trend_issm.json.gz -------------------------------------------------------------------------------- /requirements/requirements-mxnet.txt: -------------------------------------------------------------------------------- 1 | # upper bound added since numpy==1.24 broke importing mxnet, 2 | # see https://github.com/awslabs/gluonts/pull/2506 3 | numpy<1.24 4 | mxnet~=1.7 5 | -------------------------------------------------------------------------------- /docs/tutorials/data_manipulation/index.md: -------------------------------------------------------------------------------- 1 | # Data Manipulation 2 | 3 | ```{toctree} 4 | :maxdepth: 1 5 | pandasdataframes 6 | dataset_splitting_example 7 | synthetic_data_generation 8 | ``` 9 | -------------------------------------------------------------------------------- /docs/tutorials/forecasting/index.md: -------------------------------------------------------------------------------- 1 | 2 | # Basic Usage 3 | 4 | ```{toctree} 5 | :maxdepth: 1 6 | quick_start_tutorial 7 | extended_tutorial 8 | hierarchical_model_tutorial 9 | ``` 10 | -------------------------------------------------------------------------------- /requirements/requirements-extras-sagemaker-sdk.txt: -------------------------------------------------------------------------------- 1 | sagemaker~=2.0,>2.214.3 2 | s3fs~=0.6; python_version >= "3.7.0" 3 | s3fs~=0.5; python_version < "3.7.0" 4 | fsspec~=0.8,<0.9; python_version < "3.7.0" 5 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/benchmark/classic/arima_highcpu.yaml: -------------------------------------------------------------------------------- 1 | seeds: [42, 137] 2 | datasets: 3 | - taxi 4 | models: 5 | arima: 6 | - key: __instance_type__ 7 | values: [ml.c5.18xlarge] 8 | -------------------------------------------------------------------------------- /test/mx/distribution/test_lds_data/data_level_trend_weekly_seasonal_issm.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/gluonts/HEAD/test/mx/distribution/test_lds_data/data_level_trend_weekly_seasonal_issm.json.gz -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/analysis/ensembles.yaml: -------------------------------------------------------------------------------- 1 | hyperensembles: 2 | - key: model_class 3 | values: ["mqcnn", "deepar", "nbeats", "tft", "simple_feedforward"] 4 | - key: size 5 | values: [10] 6 | -------------------------------------------------------------------------------- /requirements/requirements.txt: -------------------------------------------------------------------------------- 1 | numpy>=1.16,<2.2 2 | pandas>=1.0,<3 3 | pydantic>=1.7,<3 4 | tqdm~=4.23 5 | toolz~=0.10 6 | 7 | # used for Protocol, can be removed once Python 3.8 is required 8 | typing-extensions~=4.0 9 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/benchmark/classic/prophet_highmem.yaml: -------------------------------------------------------------------------------- 1 | seeds: [42, 137] 2 | datasets: 3 | - wind_farms 4 | models: 5 | prophet: 6 | - key: __instance_type__ 7 | values: [ml.m5.2xlarge] 8 | -------------------------------------------------------------------------------- /examples/dockerfiles/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.8 2 | 3 | ADD . /gluonts 4 | 5 | RUN pip install -r /gluonts/requirements/requirements-mxnet.txt 6 | RUN pip install /gluonts[shell] 7 | 8 | ENTRYPOINT ["python", "-m", "gluonts.shell"] 9 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tsbench", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "lint": "pyright src" 6 | }, 7 | "devDependencies": { 8 | "pyright": "^1.1.206" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/_static/style.css: -------------------------------------------------------------------------------- 1 | .sidebar-brand-text, .hide-on-website { 2 | display: none; 3 | } 4 | 5 | @media (prefers-color-scheme: dark) { 6 | body:not([data-theme="light"]) .highlight { 7 | border-left: 2px solid #94b594; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /requirements/requirements-extras-statsforecast.txt: -------------------------------------------------------------------------------- 1 | # scipy cap can be removed once this is resolved: https://github.com/statsmodels/statsmodels/issues/9584 2 | scipy<1.16.0; python_version > "3.7.0" 3 | scipy~=1.7.3; python_version <= "3.7.0" 4 | statsforecast~=1.0 -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/analysis/hyper_ensembles.yaml: -------------------------------------------------------------------------------- 1 | hyperensembles: 2 | - key: model_class 3 | values: [mqcnn, deepar, nbeats, tft, simple_feedforward] 4 | - key: size 5 | values: [10] 6 | - key: surrogate.name 7 | values: [null] 8 | -------------------------------------------------------------------------------- /requirements/requirements-test.txt: -------------------------------------------------------------------------------- 1 | pandas >=1.1 2 | pytest >7.0 3 | pytest-cov >4.0,<5.0 4 | pytest-timeout >2.0, <3.0 5 | pytest-xdist >3.0, <4.0 6 | pytest-rerunfailures >=13.0, <14.0 7 | ujson 8 | orjson 9 | requests 10 | holidays~=0.9 11 | matplotlib~=3.6 12 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/analysis/ensemble_recommenders.yaml: -------------------------------------------------------------------------------- 1 | pareto: 2 | - key: objectives 3 | values: 4 | - ncrps_mean,latency_mean 5 | - key: focus_objective 6 | values: ["ncrps_mean"] 7 | - key: surrogate.name 8 | values: [deepset] 9 | -------------------------------------------------------------------------------- /src/gluonts/nursery/QRX-Wrapped-M5-Accuracy-Solution/2. data/readme.txt: -------------------------------------------------------------------------------- 1 | This folder should contain the following files: 2 | 3 | - calendar.csv 4 | - sales_train_evaluation.csv 5 | - sample_submission.csv 6 | - sell_prices.csv 7 | 8 | These can be found in the M5 competition repo. -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Questions and Discussions 4 | url: https://github.com/awslabs/gluonts/discussions 5 | about: Use GitHub Discussions to ask and answer questions, exchange ideas, and share learning. 6 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # .git/ 2 | .mypy_cache/ 3 | 4 | build 5 | dist 6 | docs 7 | test 8 | 9 | **/*.egg-info 10 | **/*.eggs/ 11 | **/*.pyc 12 | **/*.swp 13 | 14 | .tox 15 | .coverage 16 | codecov.yml 17 | **/html/* 18 | **/__pycache__ 19 | 20 | # Compiled Documentation 21 | docs/_build 22 | -------------------------------------------------------------------------------- /examples/dockerfiles/Dockerfile-gpu: -------------------------------------------------------------------------------- 1 | FROM 763104351884.dkr.ecr.us-east-1.amazonaws.com/mxnet-training:1.6.0-gpu-py36-cu101-ubuntu16.04 2 | 3 | ADD . /gluonts 4 | 5 | #RUN pip install -r /gluonts/requirements/requirements-mxnet-gpu.txt 6 | RUN pip install /gluonts[shell] 7 | 8 | ENTRYPOINT ["python", "-m", "gluonts.shell"] 9 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /requirements/requirements-docs.txt: -------------------------------------------------------------------------------- 1 | ipython 2 | ipykernel~=6.5 3 | nbconvert~=6.5.1 4 | nbsphinx~=0.9.7 5 | notedown 6 | lxml~=5.1.0 7 | pytest-runner~=2.11 8 | recommonmark 9 | sphinx~=5.0 10 | docutils~=0.19.0 11 | optuna~=2.10 12 | furo==2022.6.4.1 13 | m2r2 14 | myst-parser 15 | click 16 | orjson 17 | black 18 | holidays~=0.9 19 | matplotlib~=3.6 20 | -------------------------------------------------------------------------------- /src/gluonts/ext/README.md: -------------------------------------------------------------------------------- 1 | # `gluonts.ext` 2 | 3 | GluonTS extra models. 4 | 5 | This module contains models which are not written using PyTorch and MXNet, and 6 | therefore can't go into the `gluonts.torch` and `gluonts.mx` subpackages. 7 | 8 | Each model might require additional dependencies which need to be installed 9 | before the model can be used. 10 | -------------------------------------------------------------------------------- /requirements/requirements-pytorch.txt: -------------------------------------------------------------------------------- 1 | torch>=1.9,<3 2 | lightning>=2.2.2,<2.6 3 | # Capping `lightning` does not cap `pytorch_lightning`, so we cap manually 4 | pytorch_lightning>=2.2.2,<2.6 5 | # scipy cap can be removed once this is resolved: https://github.com/statsmodels/statsmodels/issues/9584 6 | scipy<1.16.0; python_version > "3.7.0" 7 | scipy~=1.7.3; python_version <= "3.7.0" 8 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/benchmark/deep/deepar_highmem.yaml: -------------------------------------------------------------------------------- 1 | seeds: [42, 137] 2 | datasets: 3 | - corporacion_favorita 4 | models: 5 | deepar: 6 | - key: __instance_type__ 7 | values: [ml.m5.2xlarge] 8 | - key: context_length_multiple 9 | values: [1, 2, 4, 8] 10 | - key: [num_layers, num_cells] 11 | values: [[1, 20], [2, 40], [4, 80]] 12 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/benchmark/deep/nbeats_ultramem.yaml: -------------------------------------------------------------------------------- 1 | seeds: [42, 137] 2 | datasets: 3 | - london_smart_meters 4 | models: 5 | nbeats: 6 | - key: __instance_type__ 7 | values: [ml.m5.4xlarge] 8 | - key: context_length_multiple 9 | values: [1, 2, 4, 8] 10 | - key: [num_stacks, num_blocks] 11 | values: [[4, 5], [30, 1], [30, 2]] 12 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | *Issue #, if available:* 2 | 3 | *Description of changes:* 4 | 5 | 6 | By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. 7 | 8 | 9 | **Please tag this pr with at least one of these labels to make our release process faster:** BREAKING, new feature, bug fix, other change, dev setup -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/.gitignore: -------------------------------------------------------------------------------- 1 | # MacOS 2 | *.DS_Store 3 | 4 | # Python 5 | __pycache__/ 6 | *.egg-info/ 7 | .venv/ 8 | .mypy_cache/ 9 | .ipynb_checkpoints/ 10 | 11 | # Node 12 | node_modules/ 13 | 14 | # Editor 15 | .vscode/ 16 | 17 | # Sensitive 18 | .env 19 | .ec2 20 | 21 | # Logs 22 | lightning_logs/ 23 | 24 | # Autogluon 25 | AutogluonModels/ 26 | 27 | # Submodules 28 | vendor/ 29 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/benchmark/deep/nbeats_highmem.yaml: -------------------------------------------------------------------------------- 1 | seeds: [42, 137] 2 | datasets: 3 | - corporacion_favorita 4 | - weather 5 | - wind_farms 6 | models: 7 | nbeats: 8 | - key: __instance_type__ 9 | values: [ml.m5.2xlarge] 10 | - key: context_length_multiple 11 | values: [1, 2, 4, 8] 12 | - key: [num_stacks, num_blocks] 13 | values: [[4, 5], [30, 1], [30, 2]] 14 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | 2 | # include all of gluonts 3 | graft src/gluonts 4 | 5 | # except the nursery 6 | prune src/gluonts/nursery 7 | 8 | graft docs 9 | graft requirements 10 | graft test 11 | 12 | include NOTICE 13 | 14 | prune .devtools 15 | prune .gitattributes 16 | prune .github 17 | prune examples 18 | prune evaluations 19 | 20 | exclude .dockerignore 21 | exclude .gitignore 22 | exclude dev_setup.sh 23 | 24 | global-exclude */__pycache__/* 25 | global-exclude *.pyc 26 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.8.12-buster 2 | 3 | # Install R 4 | RUN apt-get update \ 5 | && apt-get install -y r-base \ 6 | && R -e 'install.packages(c("forecast", "nnfor"), repos="https://cloud.r-project.org")' 7 | 8 | # Install project dependencies 9 | RUN pip install poetry==1.1.6 \ 10 | && poetry config virtualenvs.create false 11 | COPY poetry.lock pyproject.toml /dependencies/ 12 | RUN cd /dependencies \ 13 | && poetry install --no-dev --no-root --no-interaction --no-ansi 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: 'enhancement' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Description 11 | (A clear and concise description of what the feature is.) 12 | - If the proposal is about a new model, provide description of what the model is. 13 | - If the proposal is about an API, provide mock examples if possible. 14 | 15 | ## References 16 | - list reference and related literature 17 | - list known implementations 18 | -------------------------------------------------------------------------------- /examples/dockerfiles/Dockerfile.r: -------------------------------------------------------------------------------- 1 | FROM rpy2/base-ubuntu:latest 2 | # Change the tag in the image_name:tag above to a different version, if required. 3 | # Available tags: https://hub.docker.com/r/rpy2/base-ubuntu/tags 4 | 5 | ADD . /gluonts 6 | 7 | RUN pip install "/gluonts[shell,R]" 8 | 9 | RUN R -e 'install.packages(c("forecast", "hts"), repos="https://cloud.r-project.org")' 10 | RUN R -e 'install.packages("nnfor", repos="https://cloud.r-project.org")' 11 | 12 | ENV LC_ALL="C.UTF-8" 13 | ENV LANG="C.UTF-8" 14 | 15 | ENTRYPOINT ["python3", "-m", "gluonts.shell"] -------------------------------------------------------------------------------- /src/gluonts/nursery/daf/README.md: -------------------------------------------------------------------------------- 1 | # Source code of paper "Attention-based Domain Adaptation for Time Series Forecasting" 2 | 3 | ## Filetree 4 | * tslib: time series analysis infrastructure 5 | * network: basic neural network structures 6 | * estimator: high-level nerual architectures 7 | * engine: trainer and evaluators 8 | * dataset.py: dataset objects for training 9 | 10 | 11 | ## Reproducibility 12 | * Synthetic experiments in fewshot.ipynb 13 | * Real experiments for source dataset "a" and target dataset "b" in [a2b].ipynb 14 | * Figure 3,4,8 in fewshot.ipynb 15 | * Figure 6,9 in E2T.ipynb -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/torch/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/ext/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/model/npts/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/block/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/meta/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/shell/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/ev/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/ext/rotbaum/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/deepar/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/gpvar/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/lstnet/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/tft/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/tpp/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/time_feature/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/model/trivial/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/nursery/daf/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/torch/model/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/canonical/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/deep_factor/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/deepstate/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/deepvar/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/n_beats/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/renewal/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/seq2seq/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/transformer/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/wavenet/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/nursery/daf/tslib/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/gp_forecaster/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/nursery/SCott/model/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/nursery/daf/tslib/nn/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/deepvar_hierarchical/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /test/mx/model/simple_feedforward/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/nursery/spliced_binned_pareto/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/bin/build-container.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | echo "Building image..." 5 | docker build \ 6 | -t $REGISTRY/ts-bench:latest \ 7 | -f Dockerfile . 8 | 9 | echo "Fetching credentials from AWS..." 10 | AWS_ACCOUNT=$(aws sts get-caller-identity --query Account --output text) 11 | AWS_REGION=$(aws configure get region) 12 | ECR_PASSWORD=$(aws ecr get-login-password) 13 | REGISTRY=$AWS_ACCOUNT.dkr.ecr.$AWS_REGION.amazonaws.com 14 | 15 | echo "Logging in to ECR..." 16 | echo $ECR_PASSWORD | \ 17 | docker login --username AWS --password-stdin $REGISTRY 18 | 19 | echo "Pushing image..." 20 | docker push $REGISTRY/tsbench:latest 21 | -------------------------------------------------------------------------------- /src/gluonts/nursery/few_shot_prediction/src/meta/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/nursery/few_shot_prediction/src/meta/data/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/nursery/few_shot_prediction/src/meta/vis/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/nursery/temporal_hierarchical_forecasting/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/analysis/recommenders.yaml: -------------------------------------------------------------------------------- 1 | greedy: 2 | - key: [objectives, enforce_single_objective] 3 | values: 4 | - ["ncrps_mean,latency_mean", False] 5 | - ["ncrps_mean,latency_mean", True] 6 | 7 | optimal: 8 | - key: objectives 9 | values: 10 | - ncrps_mean,latency_mean 11 | 12 | pareto: 13 | - key: __repeat__ 14 | values: [5] 15 | - key: [surrogate.name, objectives, focus_objective] 16 | values: 17 | - ["mlp", "ncrps_mean,latency_mean", null] 18 | - ["mlp", "ncrps_mean,latency_mean", "ncrps_mean"] 19 | - ["xgboost", "ncrps_mean,latency_mean", null] 20 | - ["random", "ncrps_mean", null] 21 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/evaluations/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/nursery/temporal_hierarchical_forecasting/eval/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/nursery/temporal_hierarchical_forecasting/model/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/nursery/temporal_hierarchical_forecasting/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/attack_params/attack_config_traffic_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "factor": 3 | 2.0, 4 | "max_norm": 5 | 0.5, 6 | "sparsity": [ 7 | 1, 8 | 3, 9 | 5, 10 | 7, 11 | 9 12 | ], 13 | "attack_items":[ 14 | 1, 15 | 2, 16 | 3, 17 | 5, 18 | 6, 19 | 7, 20 | 8, 21 | 9 22 | ], 23 | "target_items": [ 24 | 0, 4 25 | ], 26 | "attack_idx": [ 27 | -2, -1 28 | ], 29 | "n_iterations": 100, 30 | "learning_rate": 0.01, 31 | "modes": [ 32 | "under", 33 | "over" 34 | ], 35 | "sigma": 0.1 36 | } -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/attack_params/attack_config_taxi_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "factor": 3 | 2.0, 4 | "max_norm": 5 | 0.5, 6 | "sparsity": [ 7 | 1, 8 | 3, 9 | 5, 10 | 7, 11 | 9 12 | ], 13 | "attack_items":[ 14 | 1, 15 | 2, 16 | 3, 17 | 4, 18 | 5, 19 | 6, 20 | 7, 21 | 8, 22 | 9 23 | ], 24 | "target_items": [ 25 | 0 26 | ], 27 | "attack_idx": [ 28 | -1 29 | ], 30 | "n_iterations": 100, 31 | "learning_rate": 0.01, 32 | "modes": [ 33 | "under", 34 | "over" 35 | ], 36 | "sigma": 37 | 0.1 38 | } -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/attack_params/attack_config_wiki_9.json: -------------------------------------------------------------------------------- 1 | { 2 | "factor": 3 | 2.0, 4 | "max_norm": 5 | 2.0, 6 | "sparsity": [ 7 | 1, 8 | 3, 9 | 5, 10 | 7, 11 | 9 12 | ], 13 | "attack_items":[ 14 | 1, 15 | 2, 16 | 3, 17 | 4, 18 | 5, 19 | 6, 20 | 7, 21 | 8, 22 | 9 23 | ], 24 | "target_items": [ 25 | 0 26 | ], 27 | "attack_idx": [ 28 | -1 29 | ], 30 | "n_iterations": 100, 31 | "learning_rate": 0.01, 32 | "modes": [ 33 | "under", 34 | "over" 35 | ], 36 | "sigma": 37 | 0.1 38 | } -------------------------------------------------------------------------------- /src/gluonts/core/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._base import fqname_for 15 | 16 | __all__ = ["fqname_for"] 17 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/attack_params/attack_config_electricity_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "factor": 3 | 2.0, 4 | "max_norm": 5 | 0.5, 6 | "sparsity": [ 7 | 1, 8 | 3, 9 | 5, 10 | 7, 11 | 9 12 | ], 13 | "attack_items":[ 14 | 1, 15 | 2, 16 | 3, 17 | 4, 18 | 5, 19 | 6, 20 | 7, 21 | 8, 22 | 9 23 | ], 24 | "target_items": [ 25 | 0 26 | ], 27 | "attack_idx": [ 28 | -1 29 | ], 30 | "n_iterations": 100, 31 | "learning_rate": 0.01, 32 | "modes": [ 33 | "under", 34 | "over" 35 | ], 36 | "sigma": 37 | 0.1 38 | } -------------------------------------------------------------------------------- /.github/workflows/lints.yml: -------------------------------------------------------------------------------- 1 | name: Ruff & Docformat 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | lint: 7 | runs-on: ubuntu-latest 8 | strategy: 9 | matrix: 10 | check: ["ruff", "docformatter"] 11 | 12 | steps: 13 | - uses: actions/checkout@v3 14 | - uses: actions/setup-python@v4 15 | with: 16 | python-version: '3.11' 17 | - name: Install tools 18 | run: pip install "ruff==0.2.2" "docformatter[tomli]==1.5.0" 19 | - name: Ruff (Flake8) 20 | if: matrix.check == 'ruff' 21 | working-directory: src/ 22 | run: ruff check . 23 | - name: Docformatter 24 | if: matrix.check == 'docformatter' 25 | run: docformatter --check -r src/ 26 | -------------------------------------------------------------------------------- /docs/404.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | Page Not Found 4 | -------------- 5 | 6 | You stumbled upon a page that's making us scratch our brains right now. Before any of us panics, 7 | we'd like you to know that you are being redirected to a better known and cozy place, in just a few seconds. 8 | 9 | .. image:: _static/404.jpg 10 | :alt: Page Not Found 11 | :width: 60% 12 | :align: center 13 | :target: ./index.html 14 | 15 | .. raw:: html 16 | 17 | 26 | -------------------------------------------------------------------------------- /src/gluonts/__main__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from gluonts.meta import cli 15 | 16 | if __name__ == "__main__": 17 | cli.cli() 18 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/dataset/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .loader import TransformedIterableDataset 15 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/dataset/repository/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .datasets import dataset_recipes 15 | -------------------------------------------------------------------------------- /src/gluonts/dataset/schema/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | 15 | from .translate import Translator 16 | 17 | __all__ = ["Translator"] 18 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/model/deepvar/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .deepvar_estimator import DeepVAREstimator 15 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/model/lstnet/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .lstnet_estimator import LSTNetEstimator 15 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/deepar/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import DeepAREstimator 15 | 16 | __all__ = ["DeepAREstimator"] 17 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/gpvar/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import GPVAREstimator 15 | 16 | __all__ = ["GPVAREstimator"] 17 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/lstnet/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import LSTNetEstimator 15 | 16 | __all__ = ["LSTNetEstimator"] 17 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/deepstate/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | from ._estimator import DeepStateEstimator 14 | 15 | __all__ = ["DeepStateEstimator"] 16 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/deepvar/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import DeepVAREstimator 15 | 16 | __all__ = ["DeepVAREstimator"] 17 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/model/transformer/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .transformer_estimator import TransformerEstimator 15 | -------------------------------------------------------------------------------- /src/gluonts/ext/naive_2/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._predictor import Naive2Predictor, naive_2 15 | 16 | __all__ = ["naive_2", "Naive2Predictor"] 17 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/canonical/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import CanonicalRNNEstimator 15 | 16 | __all__ = ["CanonicalRNNEstimator"] 17 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/deep_factor/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import DeepFactorEstimator 15 | 16 | __all__ = ["DeepFactorEstimator"] 17 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/transformer/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import TransformerEstimator 15 | 16 | __all__ = ["TransformerEstimator"] 17 | -------------------------------------------------------------------------------- /src/gluonts/model/npts/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._predictor import KernelType, NPTSPredictor 15 | 16 | __all__ = ["KernelType", "NPTSPredictor"] 17 | -------------------------------------------------------------------------------- /src/gluonts/model/seasonal_naive/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._predictor import SeasonalNaivePredictor 15 | 16 | __all__ = ["SeasonalNaivePredictor"] 17 | -------------------------------------------------------------------------------- /src/gluonts/nursery/daf/tslib/metrics/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | 15 | from .dict import MeterDict 16 | from .meters import * 17 | from .metrics import * 18 | -------------------------------------------------------------------------------- /src/gluonts/model/seasonal_agg/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._predictor import SeasonalAggregatePredictor 15 | 16 | __all__ = ["SeasonalAggregatePredictor"] 17 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/gp_forecaster/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import GaussianProcessEstimator 15 | 16 | __all__ = ["GaussianProcessEstimator"] 17 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/renewal/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import DeepRenewalProcessEstimator 15 | 16 | __all__ = ["DeepRenewalProcessEstimator"] 17 | -------------------------------------------------------------------------------- /src/gluonts/nursery/daf/tslib/nn/attention/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | 15 | from .base import Attention 16 | from .selfattn import * 17 | from .interattn import * 18 | -------------------------------------------------------------------------------- /src/gluonts/nursery/san/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import SelfAttentionEstimator 15 | 16 | __all__ = [ 17 | "SelfAttentionEstimator", 18 | ] 19 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/gluonts/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .trainer import TimedTrainer 15 | 16 | __all__ = [ 17 | "TimedTrainer", 18 | ] 19 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/simple_feedforward/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import SimpleFeedForwardEstimator 15 | 16 | __all__ = ["SimpleFeedForwardEstimator"] 17 | -------------------------------------------------------------------------------- /src/gluonts/nursery/few_shot_prediction/src/meta/common/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .torch import tensor_to_np 15 | 16 | __all__ = [ 17 | "tensor_to_np", 18 | ] 19 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/model/transformer_tempflow/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .transformer_tempflow_estimator import TransformerTempFlowEstimator 15 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/analysis/surrogate/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .analyzer import SurrogateAnalyzer 15 | 16 | __all__ = ["SurrogateAnalyzer"] 17 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/evaluations/training/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .fit import fit_estimator 15 | 16 | __all__ = [ 17 | "fit_estimator", 18 | ] 19 | -------------------------------------------------------------------------------- /src/gluonts/ext/prophet/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._predictor import PROPHET_IS_INSTALLED, ProphetPredictor 15 | 16 | __all__ = ["ProphetPredictor", "PROPHET_IS_INSTALLED"] 17 | -------------------------------------------------------------------------------- /src/gluonts/nursery/daf/tslib/engine/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | 15 | from .trainer import Trainer 16 | from .evaluator import Evaluator 17 | from .hyperopt import HyperOptManager 18 | -------------------------------------------------------------------------------- /src/gluonts/nursery/few_shot_prediction/src/meta/models/EcDc/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .series import LSTMEncoderFeedforwardDecoder 15 | from .meta import IwataKumagaiEcDc 16 | -------------------------------------------------------------------------------- /.github/workflows/style_type_checks.yml: -------------------------------------------------------------------------------- 1 | name: Style and type checks 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | style-type-checks: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v3 11 | - uses: extractions/setup-just@v1 12 | - uses: actions/setup-python@v4 13 | with: 14 | python-version: '3.11' 15 | - name: Install dependencies 16 | run: | 17 | pip install . 18 | # todo: install also `black[jupyter]` 19 | pip install click "black==24.02" "mypy==1.8.0" \ 20 | types-python-dateutil types-waitress types-PyYAML 21 | - name: Style check 22 | run: just black 23 | - name: Type check 24 | run: just mypy 25 | - name: Check license headers 26 | run: just license 27 | -------------------------------------------------------------------------------- /src/gluonts/ext/rotbaum/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import TreeEstimator 15 | from ._predictor import TreePredictor 16 | 17 | __all__ = ["TreeEstimator", "TreePredictor"] 18 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/tft/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import TemporalFusionTransformerEstimator 15 | 16 | __all__ = [ 17 | "TemporalFusionTransformerEstimator", 18 | ] 19 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/model/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .utils import get_module_forward_input_names, weighted_average 15 | from .estimator import PyTorchEstimator 16 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/model/n_beats/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .n_beats_ensemble import NBEATSEnsembleEstimator 15 | from .n_beats_estimator import NBEATSEstimator 16 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/cli/ensembles/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._main import ensembles 15 | from .simulate import simulate # type: ignore 16 | 17 | __all__ = ["ensembles"] 18 | -------------------------------------------------------------------------------- /src/gluonts/nursery/SCott/model/ar/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .ar_estimator import AREstimator 15 | from .ar_network import ( 16 | ARTrainingNetwork, 17 | ARPredictionNetwork, 18 | ) 19 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/model/deepar/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .deepar_estimator import DeepAREstimator 15 | from .deepar_network import DeepARNetwork, DeepARTrainingNetwork 16 | -------------------------------------------------------------------------------- /src/gluonts/nursery/temporal_hierarchical_forecasting/model/cop_deepar/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import COPDeepAREstimator 15 | 16 | __all__ = [ 17 | "COPDeepAREstimator", 18 | ] 19 | -------------------------------------------------------------------------------- /src/gluonts/meta/colors.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | 15 | COPPER = "#6d2f20" 16 | RED = "#b75347" 17 | SALMON = "#df7e66" 18 | ORANGE = "#e09351" 19 | YELLOW = "#edc775" 20 | GREEN = "#94b594" 21 | BLUE = "#224b5e" 22 | -------------------------------------------------------------------------------- /src/gluonts/nursery/daf/estimator/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | 15 | from .modules import AttentionEstimator, AdversarialEstimator 16 | from .domains import DomAdaptEstimator, AdversarialDomAdaptEstimator 17 | -------------------------------------------------------------------------------- /.github/workflows/tests-prophet.yaml: -------------------------------------------------------------------------------- 1 | name: Prophet Tests 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test: 7 | strategy: 8 | max-parallel: 4 9 | fail-fast: false 10 | matrix: 11 | python-version: ['3.11'] 12 | platform: [ubuntu-latest] 13 | 14 | runs-on: ${{ matrix.platform }} 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | - uses: actions/setup-python@v4 19 | with: 20 | python-version: ${{ matrix.python-version }} 21 | - name: Install other dependencies 22 | run: | 23 | pip install . \ 24 | -r requirements/requirements-test.txt \ 25 | -r requirements/requirements-extras-prophet.txt 26 | - name: Test with pytest 27 | run: | 28 | pytest -n2 --doctest-modules test/ext/prophet 29 | -------------------------------------------------------------------------------- /src/gluonts/nursery/SCott/model/lstm/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .lstm_estimator import LSTMEstimator 15 | from .lstm_network import ( 16 | LSTMTrainingNetwork, 17 | LSTMPredictionNetwork, 18 | ) 19 | -------------------------------------------------------------------------------- /src/gluonts/nursery/few_shot_prediction/src/meta/models/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .EcDc import * 15 | from .registry import MODEL_REGISTRY, get_model 16 | 17 | __all__ = ["MODEL_REGISTRY", "get_model"] 18 | -------------------------------------------------------------------------------- /src/gluonts/mx/block/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | # !!! DO NOT MODIFY !!! (pkgutil-style namespace package) 15 | 16 | from pkgutil import extend_path 17 | 18 | __path__ = extend_path(__path__, __name__) # type: ignore 19 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | # !!! DO NOT MODIFY !!! (pkgutil-style namespace package) 15 | 16 | from pkgutil import extend_path 17 | 18 | __path__ = extend_path(__path__, __name__) # type: ignore 19 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/wavenet/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import WaveNetEstimator 15 | from ._network import WaveNet, WaveNetSampler 16 | 17 | __all__ = ["WaveNet", "WaveNetEstimator", "WaveNetSampler"] 18 | -------------------------------------------------------------------------------- /src/gluonts/nursery/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | # !!! DO NOT MODIFY !!! (pkgutil-style namespace package) 15 | 16 | from pkgutil import extend_path 17 | 18 | __path__ = extend_path(__path__, __name__) # type: ignore 19 | -------------------------------------------------------------------------------- /src/gluonts/shell/sagemaker/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | 15 | from .serve import ServeEnv, ServePaths 16 | from .train import TrainEnv, TrainPaths 17 | 18 | __all__ = ["ServeEnv", "ServePaths", "TrainEnv", "TrainPaths"] 19 | -------------------------------------------------------------------------------- /src/gluonts/torch/prelude.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | # flake8: noqa: F401, F403 15 | 16 | from typing import List 17 | 18 | from .component import * 19 | from .model.forecast_generator import * 20 | 21 | __all__: List[str] = [] 22 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/cli/_main.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | import click 15 | 16 | 17 | @click.group() 18 | def main() -> None: 19 | """ 20 | Command-line interface for all scripts related to TSBench. 21 | """ 22 | -------------------------------------------------------------------------------- /src/gluonts/torch/modules/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | # !!! DO NOT MODIFY !!! (pkgutil-style namespace package) 15 | 16 | from pkgutil import extend_path 17 | 18 | __path__ = extend_path(__path__, __name__) # type: ignore 19 | -------------------------------------------------------------------------------- /src/gluonts/nursery/few_shot_prediction/src/meta/models/EcDc/components/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .attention import * 15 | from .decoder import * 16 | from .feature import * 17 | from .query import * 18 | from .supps import * 19 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/evaluations/metrics/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .metric import Metric 15 | from .performance import Performance 16 | 17 | __all__ = [ 18 | "Metric", 19 | "Performance", 20 | ] 21 | -------------------------------------------------------------------------------- /src/gluonts/torch/model/lightning_util.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | import lightning.pytorch as pl 15 | 16 | 17 | def has_validation_loop(trainer: pl.Trainer): 18 | return trainer.fit_loop.epoch_loop.val_loop._data_source.is_defined() 19 | -------------------------------------------------------------------------------- /docs/mdinclude.py: -------------------------------------------------------------------------------- 1 | from m2r2 import MdInclude 2 | 3 | # This is re-exposing `mdinclunde` from m2r2, without registering `.md`, which 4 | # we want to have handled by myst-parser. 5 | 6 | 7 | def setup(app): 8 | app.add_directive("mdinclude", MdInclude) 9 | app.add_config_value("no_underscore_emphasis", False, "env") 10 | app.add_config_value("m2r_parse_relative_links", False, "env") 11 | app.add_config_value("m2r_anonymous_references", False, "env") 12 | app.add_config_value("m2r_disable_inline_math", False, "env") 13 | app.add_config_value( 14 | "m2r_use_mermaid", 15 | "sphinxcontrib.mermaid" in app.config.extensions, 16 | "env", 17 | ) 18 | 19 | return { 20 | "version": "0.0.1", 21 | "parallel_read_safe": True, 22 | "parallel_write_safe": True, 23 | } 24 | -------------------------------------------------------------------------------- /src/gluonts/nursery/anomaly_detection/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | # !!! DO NOT MODIFY !!! (pkgutil-style namespace package) 15 | 16 | from pkgutil import extend_path 17 | 18 | __path__ = extend_path(__path__, __name__) # type: ignore 19 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/cli/evaluations/_main.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from cli._main import main 15 | 16 | 17 | @main.group() # type: ignore 18 | def evaluations(): 19 | """ 20 | Manage TSBench evaluations. 21 | """ 22 | -------------------------------------------------------------------------------- /src/gluonts/nursery/sagemaker_sdk/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | 15 | from .estimator import GluonTSFramework 16 | from .model import GluonTSModel, GluonTSPredictor 17 | 18 | __all__ = ["GluonTSFramework", "GluonTSPredictor", "GluonTSModel"] 19 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test: 7 | strategy: 8 | max-parallel: 4 9 | fail-fast: false 10 | matrix: 11 | python-version: ['3.9', '3.10', '3.11'] 12 | platform: [ubuntu-latest] 13 | 14 | runs-on: ${{ matrix.platform }} 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | - uses: actions/setup-python@v4 19 | with: 20 | python-version: ${{ matrix.python-version }} 21 | - name: Install other dependencies 22 | run: | 23 | pip install ".[mxnet,arrow,shell]" \ 24 | -r requirements/requirements-test.txt \ 25 | -r requirements/requirements-extras-m-competitions.txt 26 | - name: Test with pytest 27 | run: | 28 | pytest -n2 --doctest-modules --ignore test/nursery test 29 | -------------------------------------------------------------------------------- /src/gluonts/mx/prelude.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | # flake8: noqa: F401, F403 15 | 16 | from typing import List 17 | 18 | from .component import * 19 | from .serde import * 20 | from .model.forecast_generator import * 21 | 22 | __all__: List[str] = [] 23 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/cli/datasets/_main.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from cli._main import main 15 | 16 | 17 | @main.group() # type: ignore 18 | def datasets() -> None: 19 | """ 20 | Manage datasets available in TSBench. 21 | """ 22 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | import warnings 15 | 16 | 17 | def _suppress_useless_warnings() -> None: 18 | warnings.simplefilter("ignore", FutureWarning) 19 | 20 | 21 | _suppress_useless_warnings() 22 | -------------------------------------------------------------------------------- /.github/workflows/pypi.yml: -------------------------------------------------------------------------------- 1 | name: Publish to PyPI 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | publish-to-pypi: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v4 13 | - name: Get tags 14 | run: git fetch --tags origin 15 | - uses: actions/setup-python@v4 16 | with: 17 | python-version: '3.11' 18 | - name: Install dependencies 19 | run: | 20 | python -m pip install -U pip 21 | python -m pip install setuptools wheel 22 | - name: Create `dist` folder 23 | run: | 24 | python setup.py sdist bdist_wheel 25 | - name: Publish package 26 | uses: pypa/gh-action-pypi-publish@release/v1 27 | with: 28 | user: __token__ 29 | password: ${{ secrets.PYPI_API_TOKEN }} 30 | skip_existing: true 31 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/model/tempflow/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .tempflow_estimator import TempFlowEstimator 15 | from .tempflow_network import ( 16 | TempFlowTrainingNetwork, 17 | TempFlowPredictionNetwork, 18 | ) 19 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/cli/analysis/_main.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from cli._main import main 15 | 16 | 17 | @main.group() # type: ignore 18 | def analysis(): 19 | """ 20 | Analyze evaluations locally and track via Sacred. 21 | """ 22 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. mdinclude:: ../README.md 2 | 3 | 4 | .. toctree:: 5 | :name: Getting started 6 | :caption: Getting started 7 | :maxdepth: 1 8 | :hidden: 9 | 10 | getting_started/install 11 | getting_started/background 12 | getting_started/concepts 13 | getting_started/models 14 | 15 | .. toctree:: 16 | :name: Tutorials 17 | :caption: Tutorials 18 | :maxdepth: 1 19 | :hidden: 20 | 21 | tutorials/forecasting/index 22 | tutorials/data_manipulation/index 23 | tutorials/advanced_topics/index 24 | 25 | 26 | .. toctree:: 27 | :name: API docs 28 | :caption: API docs 29 | :maxdepth: 1 30 | :hidden: 31 | 32 | api/gluonts/gluonts 33 | 34 | .. toctree:: 35 | :name: Developing 36 | :caption: Developing 37 | :maxdepth: 1 38 | :hidden: 39 | 40 | community/contribute 41 | community/devsetup 42 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/cli/ensembles/_main.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from cli._main import main 15 | 16 | 17 | @main.group() # type: ignore 18 | def ensembles() -> None: 19 | """ 20 | Simulate ensembles of models tracked via TSBench. 21 | """ 22 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/analysis/tracking/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .client import SacredMongoClient 15 | from .experiment import SacredExperiment 16 | 17 | __all__ = [ 18 | "SacredMongoClient", 19 | "SacredExperiment", 20 | ] 21 | -------------------------------------------------------------------------------- /src/gluonts/torch/model/tide/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .module import TiDEModel 15 | from .lightning_module import TiDELightningModule 16 | from .estimator import TiDEEstimator 17 | 18 | __all__ = ["TiDEModel", "TiDELightningModule", "TiDEEstimator"] 19 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/model/causal_deepar/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .causal_deepar_estimator import CausalDeepAREstimator 15 | from .causal_deepar_network import ( 16 | CausalDeepARNetwork, 17 | CausalDeepARTrainingNetwork, 18 | ) 19 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/evaluations/tracking/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._base import Tracker 15 | from .ensemble import EnsembleTracker 16 | from .model import ModelTracker 17 | 18 | __all__ = ["Tracker", "EnsembleTracker", "ModelTracker"] 19 | -------------------------------------------------------------------------------- /src/gluonts/nursery/SCott/trainers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .Adam import Adam 15 | from .Adagrad import Adagrad 16 | from .SAdagrad import SAdagrad 17 | from .SAdam import SAdam 18 | from .SCott import SCott 19 | from .SCSG import SCSG 20 | from .SGD import SGD 21 | -------------------------------------------------------------------------------- /src/gluonts/mx/trainer/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from . import learning_rate_scheduler as lrs 15 | from . import model_averaging, model_iteration_averaging 16 | from ._base import Trainer 17 | 18 | __all__ = ["lrs", "Trainer", "model_averaging", "model_iteration_averaging"] 19 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/recommender/generator/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._base import CandidateGenerator 15 | from .replay import ReplayCandidateGenerator 16 | 17 | __all__ = [ 18 | "CandidateGenerator", 19 | "ReplayCandidateGenerator", 20 | ] 21 | -------------------------------------------------------------------------------- /src/gluonts/torch/model/lag_tst/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .module import LagTSTModel 15 | from .lightning_module import LagTSTLightningModule 16 | from .estimator import LagTSTEstimator 17 | 18 | __all__ = ["LagTSTModel", "LagTSTLightningModule", "LagTSTEstimator"] 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: 'bug' 6 | assignees: '' 7 | 8 | --- 9 | ## Description 10 | (A clear and concise description of what the bug is.) 11 | 12 | ## To Reproduce 13 | (Please provide minimal example of code snippet that reproduces the error. For existing examples, please provide link.) 14 | 15 | ```python 16 | put code here 17 | ``` 18 | 19 | ## Error message or code output 20 | (Paste the complete error message, including stack trace, or the undesired output that the above snippet produces.) 21 | 22 | ``` 23 | put error or undesired output here 24 | ``` 25 | 26 | ## Environment 27 | - Operating system: 28 | - Python version: 29 | - GluonTS version: 30 | - MXNet version: 31 | 32 | (Add as much information about your environment as possible, e.g. dependencies versions.) 33 | -------------------------------------------------------------------------------- /src/gluonts/torch/model/d_linear/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .module import DLinearModel 15 | from .lightning_module import DLinearLightningModule 16 | from .estimator import DLinearEstimator 17 | 18 | __all__ = ["DLinearModel", "DLinearLightningModule", "DLinearEstimator"] 19 | -------------------------------------------------------------------------------- /examples/dockerfiles/Dockerfile.gpu: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:9.2-cudnn7-runtime-ubuntu18.04 2 | 3 | RUN apt-get update --fix-missing && \ 4 | apt-get install -y --no-install-recommends \ 5 | wget bzip2 ca-certificates curl git build-essential \ 6 | cmake python3.7 python3.7-dev python3.7-distutils pkg-config && \ 7 | apt-get clean && \ 8 | rm -rf /var/lib/apt/lists/* 9 | RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3.7 get-pip.py 10 | 11 | # We're emulating nvidia-smi to be able to build GPU container on devices without GPU 12 | RUN echo '#!/bin/bash\necho Building container with GPU support' > /usr/bin/nvidia-smi && \ 13 | chmod +x /usr/bin/nvidia-smi 14 | 15 | ADD . /gluonts 16 | 17 | RUN pip3.7 install mxnet-cu92>=1.6.0 18 | RUN pip3.7 install /gluonts[shell] 19 | ENV MXNET_USE_FUSION=0 20 | 21 | ENTRYPOINT ["python3.7", "-m", "gluonts.shell"] 22 | -------------------------------------------------------------------------------- /src/gluonts/json.pyi: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from typing import Any 15 | 16 | def dumps(obj) -> str: ... 17 | def bdumps(obj) -> bytes: ... 18 | def dump(obj, fp, nl=False) -> None: ... 19 | def bdump(obj, fp, nl=False) -> None: ... 20 | def load(fp) -> Any: ... 21 | def loads(s) -> Any: ... 22 | -------------------------------------------------------------------------------- /src/gluonts/nursery/daf/engine/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | 15 | from .single import AttentionTrainer, AttentionEvaluator 16 | from .parallel import ( 17 | DomAdaptTrainer, 18 | DomAdaptEvaluator, 19 | AdversarialDomAdaptTrainer, 20 | AdversarialDomAdaptEvaluator, 21 | ) 22 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/model/tft/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .tft_estimator import TemporalFusionTransformerEstimator 15 | from .tft_network import ( 16 | TemporalFusionTransformerTrainingNetwork, 17 | TemporalFusionTransformerPredictionNetwork, 18 | ) 19 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/model/time_grad/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .time_grad_estimator import TimeGradEstimator 15 | from .time_grad_network import ( 16 | TimeGradTrainingNetwork, 17 | TimeGradPredictionNetwork, 18 | ) 19 | from .epsilon_theta import EpsilonTheta 20 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/cli/evaluations/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._main import evaluations 15 | from .archive import archive # type: ignore 16 | from .download import download # type: ignore 17 | from .schedule import schedule # type: ignore 18 | 19 | __all__ = ["evaluations"] 20 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/analysis/recommender/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .ensemble import EnsembleRecommenderAnalyzer 15 | from .model import ModelRecommenderAnalyzer 16 | 17 | __all__ = [ 18 | "EnsembleRecommenderAnalyzer", 19 | "ModelRecommenderAnalyzer", 20 | ] 21 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/n_beats/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._ensemble import NBEATSEnsembleEstimator, NBEATSEnsemblePredictor 15 | from ._estimator import NBEATSEstimator 16 | 17 | __all__ = [ 18 | "NBEATSEstimator", 19 | "NBEATSEnsembleEstimator", 20 | "NBEATSEnsemblePredictor", 21 | ] 22 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/model/simple_feedforward/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .simple_feedforward_estimator import SimpleFeedForwardEstimator 15 | from .simple_feedforward_network import ( 16 | SimpleFeedForwardTrainingNetwork, 17 | SimpleFeedForwardPredictionNetwork, 18 | ) 19 | -------------------------------------------------------------------------------- /src/gluonts/torch/model/deepar/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .module import DeepARModel 15 | from .lightning_module import DeepARLightningModule 16 | from .estimator import DeepAREstimator 17 | 18 | __all__ = [ 19 | "DeepARModel", 20 | "DeepARLightningModule", 21 | "DeepAREstimator", 22 | ] 23 | -------------------------------------------------------------------------------- /src/gluonts/torch/model/wavenet/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .module import WaveNet 15 | from .lightning_module import WaveNetLightningModule 16 | from .estimator import WaveNetEstimator 17 | 18 | __all__ = [ 19 | "WaveNet", 20 | "WaveNetLightningModule", 21 | "WaveNetEstimator", 22 | ] 23 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/tpp/deeptpp/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import DeepTPPEstimator 15 | from ._network import DeepTPPPredictionNetwork, DeepTPPTrainingNetwork 16 | 17 | __all__ = [ 18 | "DeepTPPEstimator", 19 | "DeepTPPTrainingNetwork", 20 | "DeepTPPPredictionNetwork", 21 | ] 22 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/evaluations/aws/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .analytics import Analysis, TrainingJob 15 | from .session import account_id, default_session 16 | 17 | __all__ = [ 18 | "Analysis", 19 | "TrainingJob", 20 | "account_id", 21 | "default_session", 22 | ] 23 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/evaluations/metrics/metric.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from dataclasses import dataclass 15 | 16 | 17 | @dataclass 18 | class Metric: 19 | """ 20 | A metric summarizes a list of values for the performance class. 21 | """ 22 | 23 | mean: float 24 | std: float 25 | -------------------------------------------------------------------------------- /src/gluonts/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | # !!! DO NOT MODIFY !!! (pkgutil-style namespace package) 15 | 16 | 17 | from pkgutil import extend_path 18 | 19 | from .meta._version import __version__ 20 | 21 | __all__ = ["__version__", "__path__"] 22 | 23 | __path__ = extend_path(__path__, __name__) # type: ignore 24 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/feature/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .holiday import ( 15 | CustomDateFeatureSet, 16 | CustomHolidayFeatureSet, 17 | ) 18 | from .fourier_date_feature import fourier_time_features_from_frequency 19 | from .lags import lags_for_fourier_time_features_from_frequency 20 | -------------------------------------------------------------------------------- /src/gluonts/shell/exceptions.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from gluonts.exceptions import GluonTSException 15 | 16 | 17 | class ForecasterNotFound(GluonTSException): 18 | """ 19 | An exception indicating that a forecaster identified by the given name 20 | cannot be found in the current environment. 21 | """ 22 | -------------------------------------------------------------------------------- /src/gluonts/torch/modules/lambda_layer.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | import torch.nn as nn 15 | 16 | 17 | class LambdaLayer(nn.Module): 18 | def __init__(self, function): 19 | super().__init__() 20 | self._func = function 21 | 22 | def forward(self, x, *args): 23 | return self._func(x, *args) 24 | -------------------------------------------------------------------------------- /src/gluonts/nursery/few_shot_prediction/src/meta/metrics/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .crps import CRPS 15 | from .quantile import QuantileLoss 16 | from .quantile_width import QuantileWidth 17 | from .nd import NormalizedDeviation 18 | 19 | __all__ = ["CRPS", "QuantileLoss", "QuantileWidth", "NormalizedDeviation"] 20 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/seq2seq/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._mq_dnn_estimator import MQCNNEstimator, MQRNNEstimator 15 | from ._seq2seq_estimator import RNN2QRForecaster, Seq2SeqEstimator 16 | 17 | __all__ = [ 18 | "MQCNNEstimator", 19 | "MQRNNEstimator", 20 | "RNN2QRForecaster", 21 | "Seq2SeqEstimator", 22 | ] 23 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/tpp/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .forecast import PointProcessSampleForecast 15 | from .predictor import PointProcessGluonPredictor 16 | from .deeptpp import DeepTPPEstimator 17 | 18 | __all__ = [ 19 | "PointProcessGluonPredictor", 20 | "PointProcessSampleForecast", 21 | "DeepTPPEstimator", 22 | ] 23 | -------------------------------------------------------------------------------- /src/gluonts/nursery/daf/network/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | 15 | from .kernel import ( 16 | AttentionKernel, 17 | ExpKernel, 18 | RBFKernel, 19 | ) 20 | from .block import ( 21 | EncoderModule, 22 | DecoderModule, 23 | AttentionBlock, 24 | AdversarialBlock, 25 | ) 26 | from .disc import SimpleDiscriminator 27 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/cli/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._main import main 15 | from .analysis import analysis # type: ignore 16 | from .datasets import datasets # type: ignore 17 | from .ensembles import ensembles # type: ignore 18 | from .evaluations import evaluations # type: ignore 19 | 20 | __all__ = ["main"] 21 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/recommender/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .pareto import ( 15 | argsort_nondominated, 16 | epsilon_net_indices, 17 | pareto_efficiency_mask, 18 | ) 19 | 20 | __all__ = [ 21 | "argsort_nondominated", 22 | "epsilon_net_indices", 23 | "pareto_efficiency_mask", 24 | ] 25 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/surrogate/transformers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .config import ConfigTransformer, EnsembleConfigTransformer 15 | from .performance import PerformanceTransformer 16 | 17 | __all__ = [ 18 | "ConfigTransformer", 19 | "EnsembleConfigTransformer", 20 | "PerformanceTransformer", 21 | ] 22 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/config/model/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._base import ModelConfig, TrainConfig 15 | from ._factory import get_model_config, MODEL_REGISTRY 16 | from .models import * 17 | 18 | __all__ = [ 19 | "ModelConfig", 20 | "TrainConfig", 21 | "get_model_config", 22 | "MODEL_REGISTRY", 23 | ] 24 | -------------------------------------------------------------------------------- /examples/dockerfiles/README.md: -------------------------------------------------------------------------------- 1 | # Instructions for using the Dockerfiles 2 | 3 | To build these dockerfiles go to the Gluon-TS root directory and enter this command: 4 | 5 | ```bash 6 | docker build . -f examples/dockerfiles/ 7 | ``` 8 | 9 | Or alternatively in the current directory: 10 | 11 | ```bash 12 | docker build ../.. -f 13 | ``` 14 | 15 | The built images are compatible with sagemaker. 16 | For more information about the shell and the available params, see the [shell documentation](https://github.com/awslabs/gluonts/tree/dev/src/gluonts/shell). 17 | 18 | 19 | ## How to choose between the dockerfiles 20 | 21 | * Dockerfile 22 | - Gluon-TS models using CPU. 23 | * Dockerfile.gpu 24 | - Gluon-TS models on a GPU accelerated machine. 25 | * Dockerfile.r 26 | - This provides dependencies for models defined in [gluonts.model.r_forecast](https://gluon-ts.mxnet.io/api/gluonts/gluonts.model.r_forecast.html). 27 | -------------------------------------------------------------------------------- /src/gluonts/torch/model/i_transformer/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .module import ITransformerModel 15 | from .lightning_module import ITransformerLightningModule 16 | from .estimator import ITransformerEstimator 17 | 18 | __all__ = [ 19 | "ITransformerModel", 20 | "ITransformerLightningModule", 21 | "ITransformerEstimator", 22 | ] 23 | -------------------------------------------------------------------------------- /test/time_feature/common.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | import pandas as pd 15 | from packaging.version import Version 16 | 17 | if Version(pd.__version__) <= Version("2.2.0"): 18 | S = "S" 19 | H = "H" 20 | M = "M" 21 | Q = "Q" 22 | Y = "A" 23 | else: 24 | S = "s" 25 | H = "h" 26 | M = "ME" 27 | Q = "QE" 28 | Y = "YE" 29 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/cli/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._main import datasets 15 | from .compute_catch22 import compute_catch22 # type: ignore 16 | from .compute_stats import compute_stats # type: ignore 17 | from .download import download # type: ignore 18 | from .upload import upload # type: ignore 19 | 20 | __all__ = ["datasets"] 21 | -------------------------------------------------------------------------------- /src/gluonts/ev/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from . import aggregations 15 | from . import metrics 16 | from . import stats 17 | from . import ts_stats 18 | 19 | 20 | __all__ = ["aggregations", "metrics", "stats", "ts_stats", "evaluate"] 21 | 22 | 23 | def evaluate(metrics, data_batches, axis=None): 24 | return metrics(axis).update_all(data_batches).get() 25 | -------------------------------------------------------------------------------- /src/gluonts/torch/model/mqf2/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .module import MQF2MultiHorizonModel 15 | from .lightning_module import MQF2MultiHorizonLightningModule 16 | from .estimator import MQF2MultiHorizonEstimator 17 | 18 | __all__ = [ 19 | "MQF2MultiHorizonModel", 20 | "MQF2MultiHorizonLightningModule", 21 | "MQF2MultiHorizonEstimator", 22 | ] 23 | -------------------------------------------------------------------------------- /.github/workflows/tests-nixtla.yaml: -------------------------------------------------------------------------------- 1 | name: Nixtla tests 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test: 7 | strategy: 8 | max-parallel: 4 9 | fail-fast: false 10 | matrix: 11 | python-version: ['3.11'] 12 | platform: [ubuntu-latest] 13 | 14 | runs-on: ${{ matrix.platform }} 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | - uses: actions/setup-python@v4 19 | with: 20 | python-version: ${{ matrix.python-version }} 21 | - name: Install other dependencies 22 | run: | 23 | pip install . \ 24 | -r requirements/requirements-test.txt \ 25 | -r requirements/requirements-extras-statsforecast.txt \ 26 | -r requirements/requirements-extras-hierarchicalforecast.txt 27 | - name: Test with pytest 28 | run: | 29 | pytest -n2 --doctest-modules test/ext/statsforecast 30 | pytest -n2 --doctest-modules test/ext/hierarchicalforecast 31 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/dataset/repository/datasets.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from functools import partial 15 | 16 | from gluonts.dataset.repository.datasets import dataset_recipes 17 | 18 | from ._m5 import generate_pts_m5_dataset 19 | 20 | dataset_recipes["pts_m5"] = partial( 21 | generate_pts_m5_dataset, pandas_freq="D", prediction_length=28 22 | ) 23 | -------------------------------------------------------------------------------- /src/gluonts/nursery/glide/sequential.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from toolz.itertoolz import concat 15 | 16 | 17 | class Apply: 18 | def __init__(self, fn, partitions: list, *args, **kwargs): 19 | self.fn = fn 20 | self.partitions = partitions 21 | 22 | def __iter__(self): 23 | yield from concat(self.fn(partition) for partition in self.partitions) 24 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/cli/analysis/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._main import analysis 15 | from .ensemble import ensemble # type: ignore 16 | from .ensemble_recommender import ensemble_recommender # type: ignore 17 | from .recommender import recommender # type: ignore 18 | from .surrogate import surrogate # type: ignore 19 | 20 | __all__ = ["analysis"] 21 | -------------------------------------------------------------------------------- /.github/workflows/tests-xgboost.yaml: -------------------------------------------------------------------------------- 1 | name: XGBoost Tests 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test: 7 | strategy: 8 | max-parallel: 4 9 | fail-fast: false 10 | matrix: 11 | python-version: ['3.11'] 12 | platform: [ubuntu-latest] 13 | 14 | runs-on: ${{ matrix.platform }} 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | - name: Set up Python ${{ matrix.python-version }} 19 | uses: actions/setup-python@v4 20 | with: 21 | python-version: ${{ matrix.python-version }} 22 | - name: Install other dependencies 23 | run: | 24 | pip install "Cython<3.0" 25 | pip install . \ 26 | -r requirements/requirements-test.txt \ 27 | -r requirements/requirements-rotbaum.txt \ 28 | -r requirements/requirements-rotbaum-extra-methods.txt 29 | - name: Test with pytest 30 | run: | 31 | pytest -n2 --timeout 120 --doctest-modules test/ext/rotbaum 32 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/benchmark/classic/prophet.yaml: -------------------------------------------------------------------------------- 1 | seeds: [42, 137] 2 | datasets: 3 | - exchange_rate 4 | - electricity 5 | - solar 6 | - wiki 7 | - taxi 8 | - m3_monthly 9 | - m3_quarterly 10 | - m3_yearly 11 | - m3_other 12 | - m4_hourly 13 | - m4_daily 14 | - m4_weekly 15 | - m4_monthly 16 | - m4_quarterly 17 | - m4_yearly 18 | - m5 19 | - tourism_monthly 20 | - tourism_quarterly 21 | - tourism_yearly 22 | - nn5 23 | - london_smart_meters 24 | - car_parts 25 | - dominick 26 | - fred_md 27 | - san_francisco_traffic 28 | - pedestrian_count 29 | - hospital 30 | - covid_deaths 31 | - kdd_2018 32 | - cif_2016 33 | - australian_electricity_demand 34 | - bitcoin 35 | - rideshare 36 | - vehicle_trips 37 | - weather 38 | - temperature_rain 39 | - m1_yearly 40 | - m1_quarterly 41 | - m1_monthly 42 | - rossmann 43 | - corporacion_favorita 44 | - walmart 45 | - restaurant 46 | models: 47 | prophet: [] 48 | -------------------------------------------------------------------------------- /.github/workflows/tests-torch.yml: -------------------------------------------------------------------------------- 1 | name: PyTorch Tests 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test: 7 | strategy: 8 | max-parallel: 4 9 | fail-fast: false 10 | matrix: 11 | python-version: ['3.9', '3.10', '3.11'] 12 | platform: [ubuntu-latest] 13 | 14 | runs-on: ${{ matrix.platform }} 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | - name: Set up Python ${{ matrix.python-version }} 19 | uses: actions/setup-python@v4 20 | with: 21 | python-version: ${{ matrix.python-version }} 22 | - name: Install dependencies 23 | run: | 24 | pip install ".[arrow,torch,shell]" \ 25 | -r requirements/requirements-test.txt \ 26 | -r requirements/requirements-extras-m-competitions.txt 27 | pip install --no-deps -r requirements/requirements-extras-cpflows.txt 28 | - name: Test with pytest 29 | run: | 30 | pytest -n2 --doctest-modules --ignore test/nursery test 31 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/benchmark/classic/arima.yaml: -------------------------------------------------------------------------------- 1 | seeds: [42, 137] 2 | datasets: 3 | - exchange_rate 4 | - electricity 5 | - solar 6 | - wiki 7 | - m3_monthly 8 | - m3_quarterly 9 | - m3_yearly 10 | - m3_other 11 | - m4_hourly 12 | - m4_daily 13 | - m4_weekly 14 | - m4_monthly 15 | - m4_quarterly 16 | - m4_yearly 17 | - m5 18 | - tourism_monthly 19 | - tourism_quarterly 20 | - tourism_yearly 21 | - nn5 22 | - london_smart_meters 23 | - wind_farms 24 | - car_parts 25 | - dominick 26 | - fred_md 27 | - san_francisco_traffic 28 | - pedestrian_count 29 | - hospital 30 | - covid_deaths 31 | - kdd_2018 32 | - cif_2016 33 | - australian_electricity_demand 34 | - bitcoin 35 | - rideshare 36 | - vehicle_trips 37 | - weather 38 | - temperature_rain 39 | - m1_yearly 40 | - m1_quarterly 41 | - m1_monthly 42 | - rossmann 43 | - corporacion_favorita 44 | - walmart 45 | - restaurant 46 | models: 47 | arima: [] 48 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .filesystem import compress_directory 15 | from .latex import float_formatter 16 | from .scatterplot import DataEntry, Dimension, plot_scatter_matrix 17 | 18 | __all__ = [ 19 | "compress_directory", 20 | "float_formatter", 21 | "DataEntry", 22 | "Dimension", 23 | "plot_scatter_matrix", 24 | ] 25 | -------------------------------------------------------------------------------- /src/gluonts/torch/model/patch_tst/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .module import PatchTSTModel, SinusoidalPositionalEmbedding 15 | from .lightning_module import PatchTSTLightningModule 16 | from .estimator import PatchTSTEstimator 17 | 18 | __all__ = [ 19 | "PatchTSTModel", 20 | "PatchTSTLightningModule", 21 | "PatchTSTEstimator", 22 | "SinusoidalPositionalEmbedding", 23 | ] 24 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/benchmark/classic/ets.yaml: -------------------------------------------------------------------------------- 1 | seeds: [42, 137] 2 | datasets: 3 | - exchange_rate 4 | - electricity 5 | - solar 6 | - wiki 7 | - taxi 8 | - m3_monthly 9 | - m3_quarterly 10 | - m3_yearly 11 | - m3_other 12 | - m4_hourly 13 | - m4_daily 14 | - m4_weekly 15 | - m4_monthly 16 | - m4_quarterly 17 | - m4_yearly 18 | - m5 19 | - tourism_monthly 20 | - tourism_quarterly 21 | - tourism_yearly 22 | - nn5 23 | - london_smart_meters 24 | - wind_farms 25 | - car_parts 26 | - dominick 27 | - fred_md 28 | - san_francisco_traffic 29 | - pedestrian_count 30 | - hospital 31 | - covid_deaths 32 | - kdd_2018 33 | - cif_2016 34 | - australian_electricity_demand 35 | - bitcoin 36 | - rideshare 37 | - vehicle_trips 38 | - weather 39 | - temperature_rain 40 | - m1_yearly 41 | - m1_quarterly 42 | - m1_monthly 43 | - rossmann 44 | - corporacion_favorita 45 | - walmart 46 | - restaurant 47 | models: 48 | ets: [] 49 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/benchmark/classic/npts.yaml: -------------------------------------------------------------------------------- 1 | seeds: [42, 137] 2 | datasets: 3 | - exchange_rate 4 | - electricity 5 | - solar 6 | - wiki 7 | - taxi 8 | - m3_monthly 9 | - m3_quarterly 10 | - m3_yearly 11 | - m3_other 12 | - m4_hourly 13 | - m4_daily 14 | - m4_weekly 15 | - m4_monthly 16 | - m4_quarterly 17 | - m4_yearly 18 | - m5 19 | - tourism_monthly 20 | - tourism_quarterly 21 | - tourism_yearly 22 | - nn5 23 | - london_smart_meters 24 | - wind_farms 25 | - car_parts 26 | - dominick 27 | - fred_md 28 | - san_francisco_traffic 29 | - pedestrian_count 30 | - hospital 31 | - covid_deaths 32 | - kdd_2018 33 | - cif_2016 34 | - australian_electricity_demand 35 | - bitcoin 36 | - rideshare 37 | - vehicle_trips 38 | - weather 39 | - temperature_rain 40 | - m1_yearly 41 | - m1_quarterly 42 | - m1_monthly 43 | - rossmann 44 | - corporacion_favorita 45 | - walmart 46 | - restaurant 47 | models: 48 | npts: [] 49 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/benchmark/classic/stlar.yaml: -------------------------------------------------------------------------------- 1 | seeds: [42] 2 | datasets: 3 | - exchange_rate 4 | - electricity 5 | - solar 6 | - wiki 7 | - taxi 8 | - m3_monthly 9 | - m3_quarterly 10 | - m3_yearly 11 | - m3_other 12 | - m4_hourly 13 | - m4_daily 14 | - m4_weekly 15 | - m4_monthly 16 | - m4_quarterly 17 | - m4_yearly 18 | - m5 19 | - tourism_monthly 20 | - tourism_quarterly 21 | - tourism_yearly 22 | - nn5 23 | - london_smart_meters 24 | - wind_farms 25 | - car_parts 26 | - dominick 27 | - fred_md 28 | - san_francisco_traffic 29 | - pedestrian_count 30 | - hospital 31 | - covid_deaths 32 | - kdd_2018 33 | - cif_2016 34 | - australian_electricity_demand 35 | - bitcoin 36 | - rideshare 37 | - vehicle_trips 38 | - weather 39 | - temperature_rain 40 | - m1_yearly 41 | - m1_quarterly 42 | - m1_monthly 43 | - rossmann 44 | - corporacion_favorita 45 | - walmart 46 | - restaurant 47 | models: 48 | stlar: [] 49 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/benchmark/classic/theta.yaml: -------------------------------------------------------------------------------- 1 | seeds: [42] 2 | datasets: 3 | - exchange_rate 4 | - electricity 5 | - solar 6 | - wiki 7 | - taxi 8 | - m3_monthly 9 | - m3_quarterly 10 | - m3_yearly 11 | - m3_other 12 | - m4_hourly 13 | - m4_daily 14 | - m4_weekly 15 | - m4_monthly 16 | - m4_quarterly 17 | - m4_yearly 18 | - m5 19 | - tourism_monthly 20 | - tourism_quarterly 21 | - tourism_yearly 22 | - nn5 23 | - london_smart_meters 24 | - wind_farms 25 | - car_parts 26 | - dominick 27 | - fred_md 28 | - san_francisco_traffic 29 | - pedestrian_count 30 | - hospital 31 | - covid_deaths 32 | - kdd_2018 33 | - cif_2016 34 | - australian_electricity_demand 35 | - bitcoin 36 | - rideshare 37 | - vehicle_trips 38 | - weather 39 | - temperature_rain 40 | - m1_yearly 41 | - m1_quarterly 42 | - m1_monthly 43 | - rossmann 44 | - corporacion_favorita 45 | - walmart 46 | - restaurant 47 | models: 48 | theta: [] 49 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/cli/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .config import ( 15 | explode_key_values, 16 | generate_configurations, 17 | iterate_configurations, 18 | ) 19 | from .subprocess import run_sacred_script 20 | 21 | __all__ = [ 22 | "explode_key_values", 23 | "generate_configurations", 24 | "iterate_configurations", 25 | "run_sacred_script", 26 | ] 27 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/deepvar_hierarchical/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | # Relative imports 15 | from ._estimator import ( 16 | projection_mat, 17 | DeepVARHierarchicalEstimator, 18 | ) 19 | from ._network import reconcile_samples, coherency_error 20 | 21 | __all__ = [ 22 | "DeepVARHierarchicalEstimator", 23 | "projection_mat", 24 | "reconcile_samples", 25 | "coherency_error", 26 | ] 27 | -------------------------------------------------------------------------------- /src/gluonts/nursery/gmm_tpp/README.md: -------------------------------------------------------------------------------- 1 | Use GMM to fit TPP with time-varying lambda that is also a function of the past. 2 | Let x=[x1, x2, ...] be the a series of inter-arrival time(-deltas). 3 | 4 | * Step 1. Fit a density function p(x1, ..., xk) = GMM(h(x1, ..., xk)) 5 | * Step 2. Infer lambda from the nonparametric density estimation 6 | 7 | Examples 8 | * Gaussian-2d 9 | + Generate independent x from GMM 10 | + Fit GMM 11 | + Match marginal likelihood 12 | 13 | * exponential-1d 14 | + Generate independent x from exp(lambda=0.5) 15 | + Fit GMM to match pdf(x) 16 | + Infer lambda=0.425 17 | 18 | * time-varying exponential 19 | + Generate independent x from exp(lambda(t)=0.1 + 2**-t) 20 | + Fit GMM to match pdf(x) 21 | + Infer lambda(0)=1.366 and lambda(2)=0.908 22 | 23 | * Hawkes process (WIP) 24 | + Generate sequential x from Hawkes with some decaying kernel 25 | + Fit GMM to match pdf(x1, ..., xk) 26 | + Infer lambda(T|x1, ..., xk) for different sequences 27 | 28 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/analysis/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .config import ConfigAnalyzer 15 | from .ensemble import EnsembleAnalyzer 16 | from .recommender import ModelRecommenderAnalyzer 17 | from .surrogate import SurrogateAnalyzer 18 | 19 | __all__ = [ 20 | "ConfigAnalyzer", 21 | "EnsembleAnalyzer", 22 | "ModelRecommenderAnalyzer", 23 | "SurrogateAnalyzer", 24 | ] 25 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/config/dataset/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._base import DatasetConfig, DatasetSplit, EvaluationDataset 15 | from ._factory import DATASET_REGISTRY, get_dataset_config 16 | from .datasets import * 17 | 18 | __all__ = [ 19 | "DatasetConfig", 20 | "DatasetSplit", 21 | "EvaluationDataset", 22 | "DATASET_REGISTRY", 23 | "get_dataset_config", 24 | ] 25 | -------------------------------------------------------------------------------- /src/gluonts/dataset/repository/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from gluonts.dataset.repository.datasets import ( 15 | get_dataset, 16 | get_download_path, 17 | dataset_recipes, 18 | default_dataset_path, 19 | dataset_names, 20 | ) 21 | 22 | __all__ = [ 23 | "get_dataset", 24 | "get_download_path", 25 | "dataset_recipes", 26 | "default_dataset_path", 27 | "dataset_names", 28 | ] 29 | -------------------------------------------------------------------------------- /src/gluonts/nursery/daf/tslib/dataset/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | 15 | from .timeseries import TimeSeries, TimeSeriesCorpus 16 | from .windows import WindowsDataset 17 | from .forecasting import ForecastingDataset 18 | from .loader import MetaDataset 19 | 20 | 21 | __all__ = [ 22 | "TimeSeries", 23 | "TimeSeriesCorpus", 24 | "WindowsDataset", 25 | "ForecastingDataset", 26 | "MetaDataset", 27 | ] 28 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/benchmark/classic/seasonal_naive.yaml: -------------------------------------------------------------------------------- 1 | seeds: [42] 2 | datasets: 3 | - exchange_rate 4 | - electricity 5 | - solar 6 | - wiki 7 | - taxi 8 | - m3_monthly 9 | - m3_quarterly 10 | - m3_yearly 11 | - m3_other 12 | - m4_hourly 13 | - m4_daily 14 | - m4_weekly 15 | - m4_monthly 16 | - m4_quarterly 17 | - m4_yearly 18 | - m5 19 | - tourism_monthly 20 | - tourism_quarterly 21 | - tourism_yearly 22 | - nn5 23 | - london_smart_meters 24 | - wind_farms 25 | - car_parts 26 | - dominick 27 | - fred_md 28 | - san_francisco_traffic 29 | - pedestrian_count 30 | - hospital 31 | - covid_deaths 32 | - kdd_2018 33 | - cif_2016 34 | - australian_electricity_demand 35 | - bitcoin 36 | - rideshare 37 | - vehicle_trips 38 | - weather 39 | - temperature_rain 40 | - m1_yearly 41 | - m1_quarterly 42 | - m1_monthly 43 | - rossmann 44 | - corporacion_favorita 45 | - walmart 46 | - restaurant 47 | models: 48 | seasonal_naive: [] 49 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/constants.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from pathlib import Path 15 | 16 | DEFAULT_DATA_PATH = Path.home() / "data" / "datasets" 17 | DEFAULT_DATA_CATCH22_PATH = Path.home() / "data" / "catch22" 18 | DEFAULT_DATA_STATS_PATH = Path.home() / "data" / "stats" 19 | 20 | DEFAULT_EVALUATIONS_PATH = Path.home() / "evaluations" 21 | DEFAULT_ENSEMBLE_EVALUATIONS_PATH = Path.home() / "ensembles" 22 | -------------------------------------------------------------------------------- /src/gluonts/torch/model/tft/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .estimator import TemporalFusionTransformerEstimator 15 | from .lightning_module import TemporalFusionTransformerLightningModule 16 | from .module import TemporalFusionTransformerModel 17 | 18 | __all__ = [ 19 | "TemporalFusionTransformerModel", 20 | "TemporalFusionTransformerLightningModule", 21 | "TemporalFusionTransformerEstimator", 22 | ] 23 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/distributions/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .utils import broadcast_shape 15 | from .zero_inflated import ( 16 | ZeroInflatedDistribution, 17 | ZeroInflatedPoisson, 18 | ZeroInflatedNegativeBinomial, 19 | ) 20 | from .piecewise_linear import PiecewiseLinear, TransformedPiecewiseLinear 21 | from .implicit_quantile import ImplicitQuantile, TransformedImplicitQuantile 22 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/surrogate/torch/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .deepset import DeepSetModel 15 | from .deepset_lightning_module import DeepSetLightningModule 16 | from .losses import ListMLELoss 17 | from .mlp_lightning_module import MLPLightningModule 18 | 19 | __all__ = [ 20 | "DeepSetModel", 21 | "DeepSetLightningModule", 22 | "MLPLightningModule", 23 | "ListMLELoss", 24 | ] 25 | -------------------------------------------------------------------------------- /test/model/npts/test_model.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from gluonts.model.npts import NPTSPredictor 15 | 16 | hyperparameters = dict( 17 | kernel_type="uniform", 18 | use_default_features=True, 19 | ) 20 | 21 | 22 | def test_accuracy(accuracy_test): 23 | accuracy_test(NPTSPredictor, hyperparameters, accuracy=0.0) 24 | 25 | 26 | def test_serialize(serialize_test): 27 | serialize_test(NPTSPredictor, hyperparameters) 28 | -------------------------------------------------------------------------------- /src/gluonts/torch/model/simple_feedforward/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .module import SimpleFeedForwardModel, make_linear_layer 15 | from .lightning_module import SimpleFeedForwardLightningModule 16 | from .estimator import SimpleFeedForwardEstimator 17 | 18 | __all__ = [ 19 | "make_linear_layer", 20 | "SimpleFeedForwardModel", 21 | "SimpleFeedForwardLightningModule", 22 | "SimpleFeedForwardEstimator", 23 | ] 24 | -------------------------------------------------------------------------------- /.github/workflows/doctests.yaml: -------------------------------------------------------------------------------- 1 | name: Doctests 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test: 7 | strategy: 8 | max-parallel: 4 9 | fail-fast: false 10 | matrix: 11 | python-version: ['3.11'] 12 | platform: [ubuntu-latest] 13 | 14 | runs-on: ${{ matrix.platform }} 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | - uses: actions/setup-python@v4 19 | with: 20 | python-version: ${{ matrix.python-version }} 21 | - name: Install other dependencies 22 | run: | 23 | pip install -e . \ 24 | -r requirements/requirements-test.txt \ 25 | -r requirements/requirements-arrow.txt 26 | - name: Test with pytest 27 | run: | 28 | pytest -n2 --doctest-modules \ 29 | src/gluonts/core \ 30 | src/gluonts/dataset \ 31 | src/gluonts/model \ 32 | src/gluonts/time_feature \ 33 | src/gluonts/zebras \ 34 | src/gluonts/maybe.py \ 35 | src/gluonts/itertools.py 36 | -------------------------------------------------------------------------------- /src/gluonts/nursery/robust-mts-attack/pts/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from pkgutil import extend_path 15 | 16 | from pkg_resources import get_distribution, DistributionNotFound 17 | 18 | from .trainer import Trainer, Trainer_adv 19 | 20 | __path__ = extend_path(__path__, __name__) # type: ignore 21 | 22 | try: 23 | __version__ = get_distribution(__name__).version 24 | except DistributionNotFound: 25 | __version__ = "0.0.0-unknown" 26 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/config/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .config import Config, EnsembleConfig 15 | from .dataset import DATASET_REGISTRY, DatasetConfig 16 | from .model import MODEL_REGISTRY, ModelConfig, TrainConfig 17 | 18 | __all__ = [ 19 | "Config", 20 | "DATASET_REGISTRY", 21 | "DatasetConfig", 22 | "EnsembleConfig", 23 | "MODEL_REGISTRY", 24 | "ModelConfig", 25 | "TrainConfig", 26 | ] 27 | -------------------------------------------------------------------------------- /src/gluonts/mx/model/forecast_generator.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from gluonts.model.forecast_generator import make_distribution_forecast 15 | from gluonts.mx.distribution import Distribution 16 | from gluonts.mx.model.forecast import DistributionForecast 17 | 18 | 19 | @make_distribution_forecast.register(Distribution) 20 | def _(distr: Distribution, *args, **kwargs) -> DistributionForecast: 21 | return DistributionForecast(distr, *args, **kwargs) 22 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/evaluations/training/logging.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | import logging 15 | from typing import Any 16 | 17 | logger = logging.getLogger(__name__) 18 | 19 | 20 | def log_metric(metric: str, value: Any) -> None: 21 | """ 22 | Logs the provided metric in the format `gluonts[]: `. 23 | """ 24 | # pylint: disable=logging-fstring-interpolation 25 | logger.info(f"gluonts[{metric}]: {value}") 26 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/utils/latex.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | import pandas as pd 15 | 16 | 17 | def float_formatter(column: pd.Series, value: float, minimize: bool = True) -> str: # type: ignore 18 | """ 19 | Returns a formatter to be used when printing data frames to LaTeX. 20 | """ 21 | if value == (column.min() if minimize else column.max()): 22 | return f"\\textbf{{{value:,.2f}}}" 23 | return f"{value:,.2f}" 24 | -------------------------------------------------------------------------------- /src/gluonts/meta/cli.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | try: 15 | import click 16 | except ImportError: 17 | import sys 18 | 19 | print("`gluonts.info` requires `click` to be installed.", file=sys.stderr) 20 | sys.exit(1) 21 | 22 | import gluonts 23 | 24 | 25 | @click.group() 26 | def cli(): 27 | pass 28 | 29 | 30 | @cli.command() 31 | def version(): 32 | click.echo(gluonts.__version__) 33 | 34 | 35 | if __name__ == "__main__": 36 | cli() 37 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/src/tsbench/gluonts/callbacks/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from .base import Callback, CallbackList 15 | from .count import ParameterCountCallback 16 | from .learning_rate import LearningRateScheduleCallback 17 | from .save import ModelSaverCallback 18 | 19 | __all__ = [ 20 | "Callback", 21 | "CallbackList", 22 | "ParameterCountCallback", 23 | "LearningRateScheduleCallback", 24 | "ModelSaverCallback", 25 | ] 26 | -------------------------------------------------------------------------------- /src/gluonts/torch/component.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | import numpy as np 15 | import torch 16 | 17 | from gluonts.core.component import equals, tensor_to_numpy 18 | 19 | 20 | @equals.register(torch.Tensor) 21 | def equals_tensor(this: torch.Tensor, that: torch.Tensor) -> bool: 22 | return torch.allclose(this, that) 23 | 24 | 25 | @tensor_to_numpy.register(torch.Tensor) 26 | def _(tensor: torch.Tensor) -> np.ndarray: 27 | return tensor.cpu().numpy() 28 | -------------------------------------------------------------------------------- /src/gluonts/dataset/artificial/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._base import ( 15 | ArtificialDataset, 16 | ComplexSeasonalTimeSeries, 17 | ConstantDataset, 18 | RecipeDataset, 19 | constant_dataset, 20 | default_synthetic, 21 | ) 22 | 23 | __all__ = [ 24 | "ArtificialDataset", 25 | "ConstantDataset", 26 | "ComplexSeasonalTimeSeries", 27 | "RecipeDataset", 28 | "constant_dataset", 29 | "default_synthetic", 30 | ] 31 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/benchmark/deep/nbeats.yaml: -------------------------------------------------------------------------------- 1 | seeds: [42, 137] 2 | datasets: 3 | - exchange_rate 4 | - electricity 5 | - solar 6 | - wiki 7 | - taxi 8 | - m3_monthly 9 | - m3_quarterly 10 | - m3_yearly 11 | - m3_other 12 | - m4_hourly 13 | - m4_daily 14 | - m4_weekly 15 | - m4_monthly 16 | - m4_quarterly 17 | - m4_yearly 18 | - m5 19 | - tourism_monthly 20 | - tourism_quarterly 21 | - tourism_yearly 22 | - nn5 23 | - car_parts 24 | - dominick 25 | - fred_md 26 | - san_francisco_traffic 27 | - pedestrian_count 28 | - hospital 29 | - covid_deaths 30 | - kdd_2018 31 | - cif_2016 32 | - australian_electricity_demand 33 | - bitcoin 34 | - rideshare 35 | - vehicle_trips 36 | - temperature_rain 37 | - m1_yearly 38 | - m1_quarterly 39 | - m1_monthly 40 | - rossmann 41 | - walmart 42 | - restaurant 43 | models: 44 | nbeats: 45 | - key: context_length_multiple 46 | values: [1, 2, 4, 8] 47 | - key: [num_stacks, num_blocks] 48 | values: [[4, 5], [30, 1], [30, 2]] 49 | -------------------------------------------------------------------------------- /src/gluonts/torch/model/deep_npts/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | from ._estimator import DeepNPTSEstimator 15 | from ._network import ( 16 | DeepNPTSNetwork, 17 | DeepNPTSMultiStepNetwork, 18 | DeepNPTSNetworkDiscrete, 19 | DeepNPTSNetworkSmooth, 20 | ) 21 | 22 | 23 | __all__ = [ 24 | "DeepNPTSEstimator", 25 | "DeepNPTSNetwork", 26 | "DeepNPTSMultiStepNetwork", 27 | "DeepNPTSNetworkDiscrete", 28 | "DeepNPTSNetworkSmooth", 29 | ] 30 | -------------------------------------------------------------------------------- /src/gluonts/nursery/SCott/commands/run_traffic.sh: -------------------------------------------------------------------------------- 1 | base_dir=`pwd` 2 | 3 | # The optimal learning rate is specified in the supplementary material 4 | lr=1e-3 5 | # SCSG, SCott, Adam, Adagrad, SAdam, SAdagrad 6 | optim=Adam 7 | # mlp, lstm, nbeats 8 | model=mlp 9 | data=traffic 10 | # gamma used for SCott version optimizers, will have no effect on other optimizers like plain Adam 11 | # the optimal gamma is specified in the supplementary material 12 | gamma=0.25 13 | 14 | job_name=${model}_${data}/${optim} 15 | 16 | run_cmd="python3 run.py --optimizer=${optim} \ 17 | --lr=${lr} \ 18 | --model=${model} \ 19 | --task_name=job_name \ 20 | --prediction_length=24 \ 21 | --context_length=72 \ 22 | --num_batches_per_epoch=10 \ 23 | --data_file=${data} \ 24 | --num_strata=49 \ 25 | --epochs=100 \ 26 | --gamma=${gamma} \ 27 | --anchor_freq=20 \ 28 | --tensorboard_path=${base_dir}/runs/${job_name} \ 29 | &> ${model}_${data}_${optim}.log" 30 | 31 | echo ${run_cmd} 32 | eval ${run_cmd} -------------------------------------------------------------------------------- /src/gluonts/nursery/SCott/commands/run_exrate.sh: -------------------------------------------------------------------------------- 1 | base_dir=`pwd` 2 | 3 | # The optimal learning rate is specified in the supplementary material 4 | lr=1e-3 5 | # SCSG, SCott, Adam, Adagrad, SAdam, SAdagrad 6 | optim=Adam 7 | # mlp, lstm, nbeats 8 | model=mlp 9 | data=exchange_rate 10 | # gamma used for SCott version optimizers, will have no effect on other optimizers like plain Adam 11 | # the optimal gamma is specified in the supplementary material 12 | gamma=0.25 13 | 14 | job_name=${model}_${data}/${optim} 15 | 16 | run_cmd="python3 run.py --optimizer=${optim} \ 17 | --lr=${lr} \ 18 | --model=${model} \ 19 | --task_name=job_name \ 20 | --prediction_length=1 \ 21 | --context_length=8 \ 22 | --num_batches_per_epoch=50 \ 23 | --data_file=job_name \ 24 | --num_strata=32 \ 25 | --epochs=100 \ 26 | --gamma=${gamma} \ 27 | --anchor_freq=20 \ 28 | --tensorboard_path=${base_dir}/runs/${job_name} \ 29 | &> ${model}_${data}_${optim}.log" 30 | 31 | echo ${run_cmd} 32 | eval ${run_cmd} -------------------------------------------------------------------------------- /src/gluonts/nursery/SCott/commands/run_synthetic.sh: -------------------------------------------------------------------------------- 1 | base_dir=`pwd` 2 | 3 | # The optimal learning rate is specified in the supplementary material 4 | lr=1e-3 5 | # SCSG, SCott, Adam, Adagrad, SAdam, SAdagrad 6 | optim=Adam 7 | # mlp, lstm, nbeats 8 | model=linear 9 | data=synthetic 10 | # gamma used for SCott version optimizers, will have no effect on other optimizers like plain Adam 11 | # the optimal gamma is specified in the supplementary material 12 | gamma=0.25 13 | 14 | job_name=${model}_${data}/${optim} 15 | 16 | run_cmd="python3 run.py --optimizer=${optim} \ 17 | --lr=${lr} \ 18 | --model=${model} \ 19 | --task_name=job_name \ 20 | --prediction_length=24 \ 21 | --context_length=72 \ 22 | --num_batches_per_epoch=50 \ 23 | --data_file=${data} \ 24 | --num_strata=16 \ 25 | --epochs=100 \ 26 | --gamma=${gamma} \ 27 | --anchor_freq=20 \ 28 | --tensorboard_path=${base_dir}/runs/${job_name} \ 29 | &> ${model}_${data}_${optim}.log" 30 | 31 | echo ${run_cmd} 32 | eval ${run_cmd} -------------------------------------------------------------------------------- /src/gluonts/nursery/few_shot_prediction/src/meta/common/torch.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. 5 | # A copy of the License is located at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed 10 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | # express or implied. See the License for the specific language governing 12 | # permissions and limitations under the License. 13 | 14 | import torch 15 | import numpy as np 16 | 17 | 18 | def tensor_to_np(tensor: torch.Tensor) -> np.ndarray: 19 | return tensor.cpu().detach().numpy() 20 | 21 | 22 | def get_mask(pad_size: torch.Size, lengths: torch.Tensor) -> torch.Tensor: 23 | device = lengths.device 24 | return torch.arange(pad_size, device=device)[None, :] < lengths[ 25 | :, None 26 | ].to(device) 27 | -------------------------------------------------------------------------------- /src/gluonts/nursery/tsbench/configs/benchmark/deep/mqrnn.yaml: -------------------------------------------------------------------------------- 1 | seeds: [42, 137] 2 | datasets: 3 | - exchange_rate 4 | - electricity 5 | - solar 6 | - wiki 7 | - taxi 8 | - m3_monthly 9 | - m3_quarterly 10 | - m3_yearly 11 | - m3_other 12 | - m4_hourly 13 | - m4_daily 14 | - m4_weekly 15 | - m4_monthly 16 | - m4_quarterly 17 | - m4_yearly 18 | - m5 19 | - tourism_monthly 20 | - tourism_quarterly 21 | - tourism_yearly 22 | - nn5 23 | - london_smart_meters 24 | - wind_farms 25 | - car_parts 26 | - dominick 27 | - fred_md 28 | - san_francisco_traffic 29 | - pedestrian_count 30 | - hospital 31 | - covid_deaths 32 | - kdd_2018 33 | - cif_2016 34 | - australian_electricity_demand 35 | - bitcoin 36 | - rideshare 37 | - vehicle_trips 38 | - weather 39 | - temperature_rain 40 | - m1_yearly 41 | - m1_quarterly 42 | - m1_monthly 43 | - rossmann 44 | - corporacion_favorita 45 | - walmart 46 | - restaurant 47 | models: 48 | mqrnn: 49 | - key: context_length_multiple 50 | values: [1, 2, 4, 8] 51 | --------------------------------------------------------------------------------