GithubHelp home page GithubHelp logo

aws-samples / amazon-sagemaker-gluonts-entrypoint Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 7.0 1.94 MB

Sample GluonTS entrypoint scripts for Amazon SageMaker.

License: MIT No Attribution

Python 40.15% Jupyter Notebook 47.94% Shell 11.91%
aws-sagemaker gluonts

amazon-sagemaker-gluonts-entrypoint's Introduction

Example Entrypoint Scripts to run GluonTS on Amazon SageMaker

This repository contains the example that supplement the blog post on using GluonTS to develop custom product demand forecasting on Amazon SageMaker, and generate demand forecasts for each products with custom models.

UPDATES:

  • the main branch has been updated to gluonts-0.8 and mxnet-1.7.
  • the blog-version branch contains the code referred by the blog post. This branch uses gluonts-0.5 and mxnet-1.6

The sample notebooks demonstrate faster experimentation with multiple custom models. The changes involves only parameteric changes to the entrypoint train script.

Structure of this repo

Implementation notes

The entrypoint train script utilizes GluonTS to work with time series data in a simpler fashion, and to access many state-of-the-art custom models in the GluonTS library. The novelties demonstrated by the script include:

  • a single generic train script that supports multiple built-in algorithms in GluonTS.

  • Guide modular style implementation in notebooks and entrypoint scripts.

  • The train script passes through hyperparameters which it receives as command line arguments, directly to the specified GluonTS estimator.

    • The entrypoint train script does not need to explicitly declare all those hyperpameters in its body.

    • This functionality utilizes another sample repository: aws-samples/amazon-sagemaker-entrypoint-utilities, a dependency that the entrypoint train script declares in its requirements.txt

  • At the end of training, the train script performs backtesting on a test split. Then, the script outputs to files the backtest performance metrics, the forecasts resulted from test split, and backtest plots of all timeseries as montages and individual plots.

    • This is done by design, and the aim is to let data scientists quickly analyze their model performance without having to separately run inferences (and additional downstream tasks for plotting etc.).

    • This functionality utilizes another sample repository: aws-samples/smallmatter-package, a dependency that the entrypoint train script declares in its requirements.txt

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

Authors

  • Verdi March GitHub
  • Beibit Baktygaliyev
  • Zmnako Awrahman GitHub

amazon-sagemaker-gluonts-entrypoint's People

Contributors

amazon-auto avatar mlonaws avatar verdimrc avatar yinsong1986 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

amazon-sagemaker-gluonts-entrypoint's Issues

Training job failed when executing train.py

Hi,
Thanks for this great sample code.

I followed all the instructions. But the training job fails.

I'm getting the following message:
AlgorithmError: ExecuteUserScriptError: Command "/usr/local/bin/python3.6 train.py --algo gluonts.model.deepar.DeepAREstimator --cardinality [151] --cell_type gru --distr_output.__class__ gluonts.distribution.gaussian.GaussianOutput --num_cells 46 --num_layers 4 --num_samples 1000 --plot_transparent 0 --prediction_length 30 --trainer.__class__ gluonts.trainer.Trainer --trainer.epochs 200 --trainer.learning_rate 0.0005490034989544101 --use_feat_static_cat True"

The Traceback in cloud watch provides me with this error

Traceback (most recent call last):
  File "train.py", line 197, in <module>
    train(args, smepu.argparse.to_kwargs(train_args))
  File "/usr/local/lib/python3.6/site-packages/smepu/argparse.py", line 83, in to_kwargs
    args_round_2 = _round_2(args_round_1)  # Custom class in IR
  File "/usr/local/lib/python3.6/site-packages/smepu/argparse.py", line 211, in _round_2
    desered = {k: decode(v.klass_dict) for k, v in ir.items()}
  File "/usr/local/lib/python3.6/site-packages/smepu/argparse.py", line 211, in <dictcomp>
    desered = {k: decode(v.klass_dict) for k, v in ir.items()}
  File "/usr/local/lib/python3.6/site-packages/smepu/_gluonts_core_serde.py", line 49, in decode
    return cls(*args, **kwargs)  # type: ignore

TypeError: 'NoneType' object is not callable

I'm using latest gluonts release 0.7.6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.