from tsfast.datasets.core import create_dls_test
from tsfast.learner import RNNLearner
from tsfast.prediction import FranSysLearner
Inference
Pytorch Modules for Training Models for sequential data
InferenceWrapper
InferenceWrapper (learner, device='cpu')
A wrapper class to simplify inference with a trained tsfast/fastai Learner on NumPy data. Handles normalization and state reset automatically.
= create_dls_test()
dls = RNNLearner(dls)
lrn = InferenceWrapper(lrn) model
100, 1)).shape model(np.random.randn(
(100, 1)
100)).shape model(np.random.randn(
(100, 1)
1,100,1)).shape model(np.random.randn(
(100, 1)
= FranSysLearner(dls,10,attach_output=True)
lrn = InferenceWrapper(lrn) model
100, 1),np.random.randn(100, 1)).shape model(np.random.randn(
(100, 1)