Chengyui / NuwaTS

NuwaTS: a Foundation Model Mending Every Incomplete Time Series
https://arxiv.org/abs/2405.15317v3
50 stars 4 forks source link

Reproducing your `.ipynb` #2

Open petteriTeikari opened 1 week ago

petteriTeikari commented 1 week ago

Hi

I ran into some issues with your notebook?

1) args = get_parser() was not defined anywhere. I assumed that it was just the run.py args then inside a function?

2) Where is this gpt2/gpt2/ or how was it downloaded as I assumed that it maybe was the OpenAI huggingface? (https://huggingface.co/openai-community/gpt2)? As the https://github.com/Chengyui/NuwaTS/blob/d76888af246a3cdf01db3f067bde2339ff17d047/models/NuwaTS.py#L105 crashed there

Chengyui commented 1 week ago

image For Q1, you could run the first commad in jupyter notebook which will download and unzip the files containing the function. For Q2, there is no need to download GPT2 weight from hugging face, because the code in NuwaTS.py like this: image For inference in jupyter notebook, we do not load the origin weight, just randomly initialize the model, and then load the weight from the unziped files. If you want to train the model ,run the code from the github code base rather than the code from jupyter notebook.

petteriTeikari commented 4 days ago

Hi,

Thanks a lot for the clarifications and I got the gpt2 defined now, and got (1) zeroshot working on my own data, and (2) finetuning with my own data. Got however for some of my samples inf predictions in (1) case (not all), and in (2) got then all-out nan predictions, and could not immediately get why this happened though.

Chengyui commented 4 days ago

Hi,

Thanks a lot for the clarifications and I got the gpt2 defined now, and got (1) zeroshot working on my own data, and (2) finetuning with my own data. Got however for some of my samples inf predictions in (1) case (not all), and in (2) got then all-out nan predictions, and could not immediately get why this happened though.

see https://github.com/Chengyui/NuwaTS/blob/master/models/NuwaTS.py, line 286 and line 293 could deal with the NaN bug. It must be the whole input of some variable are all masked, then the variance or mean is nan. You could update the code in the jupyter notebook. Thanks a lot!! Hope everything gonna be ok!