Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quick start examples #21

Open
zhangzw16 opened this issue Jul 15, 2024 · 0 comments
Open

Add quick start examples #21

zhangzw16 opened this issue Jul 15, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@zhangzw16
Copy link
Collaborator

Currently, we only support running with a configuration file using python run.py

To make it more user-friendly for new users, we can add the ability to train and infer time-series models with just a few lines of code. For example:

# load_model by one line of code
from probts.model.forecaster.point_forecaster.units import UniTS
units = UniTS(ckpt_path='checkpoints/units/units_x128_pretrain_checkpoint.pth', target_dim=1, context_length=96, prediction_length=96, freq='H', lags_list=[])

from probts.model.forecaster.prob_forecaster.moirai import Moirai
moirai = Moirai(target_dim=1, context_length=96, prediction_length=96, freq='H', lags_list=[], patch_size=32, variate_mode='S', model_size='small')

# load data by one line of code
data_manager = DataManager("traffic", history_length=96, context_length=96, prediction_length=96, scaler='standard')
data_loader = DataLoader(data_manager.test_iter_dataset, batch_size=1)

# train and inference examples
# TODO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant