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

I can't see the model's detail in the code #11

Open
signalworker123 opened this issue Nov 4, 2022 · 7 comments
Open

I can't see the model's detail in the code #11

signalworker123 opened this issue Nov 4, 2022 · 7 comments

Comments

@signalworker123
Copy link

I want see the model's detail in the code,but i found the Pytorch Lightning in the pycharm can't debug, they just run,how can i see the training data flows in the model? And it will makes me understand the model better. Thank you.

@kdgutier
Copy link
Collaborator

kdgutier commented Nov 4, 2022

Hi @signalworker123,

N-HiTS is based on deep stacked MLPs with doubly residual connections for the forecast and backast signals. The main contributions to the architecture are the input pooling and the use of hierarchical interpolation for the multi-step predictions strategy. See Figure below:
Screenshot 2022-11-04 at 8 31 45 AM

@kdgutier
Copy link
Collaborator

kdgutier commented Nov 4, 2022

Regarding data flows you might want to try:
pip install torchinfo

How is Pycharm (the IDE) related to visualization of data flows of a Pytorch model?
Would you be able to share the bug?

@signalworker123
Copy link
Author

Thank you very much ! I just a little confuse about the hierarchical interpolation , I want to see the detail to hierarchical interpolation in the code ,but when I use Pycharm debug in the experiment/utils.model_fit_predict
that is
trainer = pl.Trainer(max_epochs=mc['max_epochs'],
max_steps=mc['max_steps'],
check_val_every_n_epoch=mc['eval_freq'],
progress_bar_refresh_rate=1,
gpus=gpus,
callbacks=callbacks,
checkpoint_callback=False,
logger=False)
trainer.fit(model, train_loader, val_loader)

the trainer.fit can't debug in ,so I can't see the training data how to flow in the model .
Actualy there is no bug in my code , but I jusy want to have a sensibility feeling about the hierarchical interpolation.

@kdgutier
Copy link
Collaborator

kdgutier commented Nov 4, 2022

Interpolation code is performed in here, where we take thetas and recover forecast size.
While hierarchical interpolation is achieved by reducing the coefficient's theta expressivity.

This plot captures the intuition of hierarchical interpolation, and the induced layers frequency specialization (and the time locality beyond Fourier transform):
Screenshot 2022-11-04 at 8 48 41 AM

If you are interested in the theory behind it, we found very cool connections between the hierarchical interpolation mechanism and wavelet transforms. They are available in the neural basis expansion theorem.

@kdgutier
Copy link
Collaborator

kdgutier commented Nov 4, 2022

By the way @signalworker123,

We are focusing now our efforts in the NeuralForecast library where we already host NHITS along with other cool SoTA algorithms.

@signalworker123
Copy link
Author

Thank you again, I think I should learn more about Pytorch Lighting and read you paper more carefully.I just try informer before but it doesn't work well. I just notice you mentioned library when I chatting with you , thank you . I well try the Demo in the library.

@kdgutier
Copy link
Collaborator

kdgutier commented Nov 4, 2022

Here is the NeuralForecast NHITS example and documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants