A way to use fastai with sequence data
Installing
Please install fastai2 according to the instructions.
Then install Fastseq by:
git clone https://github.com/takotab/fastseq.git
cd fastseq
pip install -e .
Please be aware that this extention on fastai2 is made for univarate data (The difference is explained here).
If you have tried it, please let me know. Even if you got stuck and werent able to install. You can send me an email, leave a comment in the (excelent) fastai timeseries forum, or make an issue in github. I would love to know what you think of libary any tips or comments. Do you work on these kind of data, would want more explanation of the model, would you like to see the approuch on multivariate ts. Where do think I should go with this.
Thank you
from fastai2.basics import *
from fastseq.all import *
from fastseq.nbeats.model import *
from fastseq.nbeats.learner import *
from fastseq.nbeats.callbacks import *
horizon, lookback = 7, 35
Getting the data fastai style:
path = untar_data(URLs.m4_daily)
data = TSDataLoaders.from_folder(path, horizon = horizon, lookback = lookback, nrows = 300, step=3)
data.show_batch()
learn = nbeats_learner(data, season = lookback+horizon)
from fastai2.callback.all import *
learn.lr_find()
learn.fit_flat_cos(5, 2e-2)
learn.recorder.plot_loss()
learn.recorder.plot_sched()
learn.show_results(0)
learn.show_results(1)
learn.fit_flat_cos(1,5e-4)
learn.recorder.plot_loss()
learn.recorder.plot_sched()
learn.n_beats_attention.means()
interp = NBeatsInterpretation.from_learner(learn)
interp.plot_top_losses(3, combine_stack=True)