• Stars
    star
    509
  • Rank 86,772 (Top 2 %)
  • Language
    Python
  • License
    Other
  • Created over 5 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

N-BEATS is a neural-network based model for univariate timeseries forecasting. N-BEATS is a ServiceNow Research project that was started at Element AI.

ServiceNow completed its acquisition of Element AI on January 8, 2021. All references to Element AI in the materials that are part of this project should refer to ServiceNow.

N-BEATS

This repo provides an implementation of the N-BEATS algorithm introduced in https://arxiv.org/abs/1905.10437 and enables reproducing the experimental results presented in the paper.

N-BEATS is a neural-network based model for univariate timeseries forecasting.

N-BEATS Architecture

Repository Structure

Model

PyTorch implementation of N-BEATS can be found in models/nbeats.py

Datasets

The loaders for each dataset used in the paper are in datasets/*.py

Experiments

Experiments to reproduce the paper results are located in experiments/*, where each experiment package contains main.py with the training and forecasting logic along with two configuration files for both generic and interpretable models.

Results

The notebooks directory contains a notebook per experiment with the final scores. We also included the results for 10 times smaller ensembles, you can see that the difference is not significant. Note: This is a "lighter" version of original N-BEATS which performs slightly different, sometimes better sometimes worse but overall on the same SOTA level.

How to reproduce the results

Make sure you have docker installed. Using NVidia GPUs is preferable, but not required. Depending on your environment you may need to adjust Makefile's docker image name and write additional logic to train models in parallel.

The default configuration is using 10 repeats what produces up to 180 models per experiment, as you can see in notebooks the difference between big and small ensembles is not significant. To switch to small ensemble set build.repeats = 1 in *.gin files for experiments you want to run (they are located in experiments/*/*.gin).

  1. Build docker image

    make init
  2. Download datasets

    make dataset

    This command will download dataset into ./storage/datasets directory

  3. (Optional) Test metrics. To make sure that all datasets are correct and the metrics calculation works as expected you can run test.

    make test
  4. Build an experiment

    make build config=experiments/m4/interpretable.gin

    This will generate directories with configurations and command for each model of ensemble in ./storage/experiments/m4_interpretable. Note that the config parameter takes the relative path to actual configuration.

  5. Run experiments. Substitute different values for repeat and lookback in the command lines below to run other configurations of a model.

    CPU

    make run command=storage/experiments/m4_interpretable/repeat=0,lookback=2,loss=MAPE/command

    GPU

     make run command=storage/experiments/m4_interpretable/repeat=0,lookback=2,loss=MAPE/command gpu=<gpu-id>

    If you have multiple GPUs on the same machine then run this command in parallel for each gpu-id.

    The logs, losses, snapshots and final forecasts will be stored in storage/experiments/m4_interpretable/repeat=0,lookback=2,loss=MAPE directory.

    You can of course automate running across all experiments with the following example (assuming BASH):

    for instance in `/bin/ls -d storage/experiments/m4_interpretable/*`; do 
        echo $instance
        make run command=${instance}/command
    done

    If you have resources where the training can be scaled in a "cloud", then consider adding a new target to the Makefile. Below is an example in pseudo-code:

    run-all:
    rsync ${ROOT} ${network-share}
    for instance in $$(ls ${ROOT}/${experiment}); do \
    	cloud submit \
    			--image=${IMAGE} \
    			-v ${network-share}:/experiment \
    			-w /experiment \
    			-e PYTHONPATH=/experiment \
    			-e STORAGE=/experiment/storage \
    			-- \
    			bash -c "`cat ${ROOT}/${experiment}/$${instance}/command`"; \
    done
  6. Get the experiment statistics.

    Note: If the experiment was running in a cloud make sure the results are downloaded into storage/experiments.

    Start JupyterLab make notebook port=<port>

    Run a notebook in notebooks directory for the corresponding experiment to get the experiment's performance statistics.

Citation

If you use N-BEATS in any context, please cite the following paper:

@inproceedings{
  Oreshkin2020:N-BEATS,
  title={{N-BEATS}: Neural basis expansion analysis for interpretable time series forecasting},
  author={Boris N. Oreshkin and Dmitri Carpov and Nicolas Chapados and Yoshua Bengio},
  booktitle={International Conference on Learning Representations},
  year={2020},
  url={https://openreview.net/forum?id=r1ecqn4YwB}
}

This is a collaborative work between Element AI and Mila. Please cite the paper if you use this model or the code.

More Repositories

1

picard

PICARD - Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Models. PICARD is a ServiceNow Research project that was started at Element AI.
Haskell
340
star
2

HighRes-net

Pytorch implementation of HighRes-net, a neural network for multi-frame super-resolution, trained and tested on the European Space Agency’s Kelvin competition. This is a ServiceNow Research project that was started at Element AI.
Jupyter Notebook
278
star
3

BrowserGym

BrowserGym, a gym environment for web task automation in the Chromium browser.
Python
272
star
4

embedding-propagation

Codebase for Embedding Propagation: Smoother Manifold for Few-Shot Classification. This is a ServiceNow Research project that was started at Element AI.
Python
208
star
5

LCFCN

ECCV 2018 - Where are the Blobs: Counting by Localization with Point Supervision. This is a ServiceNow Research project that was started at Element AI.
Python
169
star
6

seasonal-contrast

seasonal-contrast is a ServiceNow Research project that was started at Element AI.
Python
161
star
7

TACTiS

TACTiS-2: Better, Faster, Simpler Attentional Copulas for Multivariate Time Series, from ServiceNow Research
Python
126
star
8

stl-decomp-4j

Java implementation of Seasonal-Trend-Loess time-series decomposition algorithm.
Java
116
star
9

TADAM

The implementation of https://papers.nips.cc/paper/7352-tadam-task-dependent-adaptive-metric-for-improved-few-shot-learning . TADAM is a ServiceNow Research project that was started at Element AI.
Jupyter Notebook
106
star
10

WorkArena

WorkArena: How Capable are Web Agents at Solving Common Knowledge Work Tasks?
Python
105
star
11

osaka

Codebase for "Online Fast Adaptation and Knowledge Accumulation: a New Approach to Continual Learning". This is a ServiceNow Research project that was started at Element AI.
Python
102
star
12

example-restclient-myworkapp-nodejs

This project contains source code for an example Node.js web application that interacts with ServiceNow's REST APIs.
JavaScript
97
star
13

geo-bench

GEO-Bench: Toward Foundation Models for Earth Monitoring
Python
80
star
14

PySNC

Python API for ServiceNow
Python
76
star
15

am3

Adaptive Cross-Modal Few-shot learning OSS code. This is a ServiceNow Research project that was started at Element AI.
Python
65
star
16

devtraining-needit-utah

65
star
17

multithreaded-estimators

Multithreading inference in Tensorflow Estimators. This is a ServiceNow Research project that was started at Element AI.
Python
57
star
18

duorat

DuoRAT is a ServiceNow Research project that was started at Element AI.
Python
55
star
19

TapeAgents

TapeAgents is a framework that facilitates all stages of the LLM Agent development lifecycle
Python
51
star
20

azimuth

Helping AI practitioners better understand their datasets and models in text classification. From ServiceNow.
Python
51
star
21

synbols

The Synbols dataset generator is a ServiceNow Research project that was started at Element AI.
Python
43
star
22

app-dev-methodology

38
star
23

devtraining-needit-tokyo

This repository is used by the Developer Site training content, Tokyo release.
36
star
24

HypE

Knowledge Hypergraphs: Prediction Beyond Binary Relations is a ServiceNow Research project that was started at Element AI.
Python
30
star
25

devtraining-needit-paris

This repository is used by the developer site training content, Paris release. It is used for the Build the NeedIt App, Scripting in ServiceNow, Application Security, Importing Data, Automating Application Logic, Flow Designer, REST Integrations, Reporting and Analytics, Domain Separation, Mobile Applications, and Context-sensitive Help courses.
29
star
26

data-augmentation-with-llms

Data Augmentation for Intent Classification with Off-the-Shelf Large Language Models is a ServiceNow Research project
Python
28
star
27

devtraining-needit-quebec

This repository is used by the developer site training content, Paris release. It is used for the Build the NeedIt App, Scripting in ServiceNow, Application Security, Importing Data, Automating Application Logic, Flow Designer, REST Integrations, Reporting and Analytics, Domain Separation, Mobile Applications, and Context-sensitive Help courses.
27
star
28

bilevel_augment

bilevel_augment is a ServiceNow Research project that was started at Element AI.
Jupyter Notebook
26
star
29

servicenow-cli

Alternative download for ServiceNow CLI clients.
26
star
30

devtraining-needit-rome

This repository is used by the developer site training content, Rome release. It is used for the Build the NeedIt App, Scripting in ServiceNow, Application Security, Importing Data, Automating Application Logic, Flow Designer, REST Integrations, Reporting and Analytics, Domain Separation, Mobile Applications, and Context-sensitive Help courses.
26
star
31

wise_ils

BMVC 2019 - Where are the Masks: Instance Segmentation with Image-level Supervision. This is a ServiceNow Research project that was started at Element AI.
Python
25
star
32

ALM

Documentation, guides, templates, everything else in between for Application Lifecycle Management at ServiceNow.
23
star
33

sncicd_githubworkflow

.yml sample pipeline template for workflow
21
star
34

example-restclient-myworkapp-ios

This project contains source code for an example iOS application that interacts with ServiceNow's REST APIs.
Objective-C
20
star
35

servicenow-devops-change

JavaScript
18
star
36

devtraining-needit-sandiego

This repository is used by the Developer Site training content, San Diego release.
18
star
37

AgentLab

Python
18
star
38

avenue

Avenue is a simulator designed to test and prototype reinforcement learning algorithms. Avenue is a ServiceNow Research project that was started at Element AI.
Python
15
star
39

context-is-key-forecasting

Context is Key: A Benchmark for Forecasting with Essential Textual Information
Jupyter Notebook
15
star
40

atf-headless-runner

RobotFramework
14
star
41

sncicd-instance-scan

TypeScript
13
star
42

typed-dag

Causal discovery with typed directed acyclic graphs (t-DAG). This is a ServiceNow Research project that was started at Element AI.
Python
13
star
43

beyond-trivial-explanations

Beyond Trivial Counterfactual Explanations with Diverse Valuable Explanations is a ServiceNow Research project that was started at Element AI.
Python
13
star
44

servicenow-cicd-azure-extension

Extension for Azure Pipelines to help developers get started faster with ServiceNow's CI/CD APIs
JavaScript
12
star
45

sncicd-apply-changes

TypeScript
12
star
46

MiniTouch

MiniTouch is a ServiceNow Research project that was started at Element AI.
Python
11
star
47

sncicd-gitlab-docker

Docker image containing build steps for running your ServiceNow CI/CD pipelines on GitLab.
JavaScript
10
star
48

synbols-benchmarks

Benchmarks for the Synbols project. Synbols is a ServiceNow Research project that was started at Element AI.
Python
10
star
49

promptmix-emnlp-2023

Offical code repository for PromptMix: A Class Boundary Augmentation Method for Large Language Model Distillation, EMNLP 2023
Python
10
star
50

bytesteady

A fast classification and tagging tool using byte-level n-gram embeddings. bytesteady is a ServiceNow Research project that was started at Element AI.
C++
10
star
51

sncicd-plugin-activate

TypeScript
8
star
52

sncicd-publish-app

TypeScript
8
star
53

sncicd-batch-install

TypeScript
8
star
54

better-ui

ServiceNow UI giving you back the full width of your screen
8
star
55

active-fairness

Code for the paper "Can Active Learning Preemptively Mitigate Fairness Issues?" presented at RAI 2021. This is a ServiceNow Research project that was started at Element AI.
Jupyter Notebook
8
star
56

tk-knn

Python
7
star
57

a-day-in-the-life-of-a-ux-engineer

This is a sample repository for Platform UX Engineering
JavaScript
7
star
58

fashiongen-challenge-template

Base template to submit a model for the challenge. Fashiogen is a ServiceNow Research project that was started at Element AI.
Dockerfile
7
star
59

RepoFusion

This repository contains code for data preparation and experiments for pre training llm with repository level context in various ways
Python
6
star
60

build-pynini-wheels

Build `manylinux2014_x86_64` Python wheels for `pynini`, wrapping all its dependencies. This is a ServiceNow Research project that was started at Element AI.
Dockerfile
6
star
61

sncicd-plugin-rollback

TypeScript
6
star
62

devtraining-createnotes-orlando

Repository for the Service Portal Creating Custom Widgets module, Orlando release.
6
star
63

sncicd-tests-run

TypeScript
6
star
64

K15APIDemo

K15APIDemo
Swift
6
star
65

sncicd-install-app

TypeScript
6
star
66

radar.apple.com

Samples for Apple Radars.
Objective-C
5
star
67

workflow-discovery

Python
5
star
68

sncicd-rollback-app

TypeScript
4
star
69

THANOS

This ANOmaly is Synthetic - A Timeseries Recipe Data Generator
Jupyter Notebook
4
star
70

SISR

PyTorch-SRGAN is a modern PyTorch implementation of SRGAN Single Example Super Resolution. PyTorch-SRGAN is a ServiceNow Research project that was started at Element AI.
Python
4
star
71

Alpha-UX

Design guidelines and specs for SIR UX
HTML
4
star
72

devtraining-createnotes-paris

Repository for the Service Portal Creating Custom Widgets module, Paris release.
3
star
73

servicenow-devops-test-report

JavaScript
3
star
74

mid-cyberark-external-credential-resolver

MID Server External Credential Resolver for CyberArk vault.
Java
3
star
75

regions-of-reliability

Regions of Reliability in the Evaluation of Multivariate Probabilistic Forecasts
Python
3
star
76

K16-dd-order-tracking

3
star
77

servicenow-devops-get-change

We are creating new custom actions for Github Actions feature of Github. These actions are needed for ITSM DevOps product.
JavaScript
3
star
78

dir_lines_streamer

Rust crate allowing reading files inside a directory line-by-line, one file after the other (in human-alphabetical order). dir_lines_streamer is a ServiceNow Research project that was started at Element AI.
Rust
3
star
79

geo-bench-experiments

Python
3
star
80

servicenow-devops-sonar

JavaScript
2
star
81

devtraining-createnotes-tokyo

Repository for the Service Portal Creating Custom Widgets learning module, Tokyo release.
2
star
82

ExperienceHub

HTML
2
star
83

VA-iOS-SDK

Virtual Agent SDK for iOS native apps. Used to add VA to an existing app.
2
star
84

broad

Functionality to download and prepare BROAD, an image evaluation dataset for broad OOD detection.
Python
2
star
85

neighbour-distance

neighbour-distance is a ServiceNow Research project that was started at Element AI.
Jupyter Notebook
2
star
86

synbols-resources

Resources for the Synbols dataset generator. Synbols is a ServiceNow Research project that was started at Element AI.
PureBasic
2
star
87

devtraining-createnotes-rome

Repository for the Service Portal Creating Custom Widgets module, Rome release.
2
star
88

servicenow-devops-config-validate

JavaScript
2
star
89

servicenow-devops-update-change

We are creating new custom actions for Github Actions feature of Github. These actions are needed for ITSM DevOps product.
JavaScript
2
star
90

repliqa

A Question-Answering Dataset on Unseen Content [Details Coming Soon!]
Jupyter Notebook
2
star
91

agent-poirot

1
star
92

lightstep-ir-grafana-metrics

1
star
93

devtraining-application-release

1
star
94

devtraining-createnotes-sandiego

Repository for the Service Portal Creating Custom Widgets module, San Diego release.
1
star
95

FigmaResources

Archive of prior release Figma libraries
1
star
96

research

Unlock work experiences of the future. Join ServiceNow Research as we advance the state-of-the-art in Enterprise AI.
1
star
97

devtraining-createnotes-quebec

Repository for the Service Portal Creating Custom Widgets module, Quebec release.
1
star
98

acc-ansible

1
star
99

sn_ss_api_matrix

ServiceNow Server Side API Matrix
1
star
100

Public-Sector-Innovation-Community

1
star