blog icon indicating copy to clipboard operation
blog copied to clipboard

How to train the autoformer?

Open AppleMax1992 opened this issue 2 years ago • 8 comments

Dear authors,

I have read your blog at https://huggingface.co/blog/autoformer, it is great to explain why transformer is better than Dlinear. However, I am wondering how to train my own Autoformer instead of using a pretrained Autoformer.

Best regards

AppleMax1992 avatar Jul 28 '23 03:07 AppleMax1992

cc: @kashif @NielsRogge

Vaibhavs10 avatar Aug 03 '23 19:08 Vaibhavs10

@Vaibhavs10 thanks! I have already guided him and am helping him remotely.

kashif avatar Aug 03 '23 19:08 kashif

Dear @AppleMax1992, can you help me with this same question?

Best regards

Duduzao123 avatar Aug 25 '23 13:08 Duduzao123

Dear @AppleMax1992, can you help me with this same question?

Best regards

Same issue

dkagramanyan avatar Sep 01 '23 16:09 dkagramanyan

I'm sorry but I didn't get any answer so far. However, I tried to find the answer myself from here https://github.com/thuml/Autoformer/blob/main/predict.ipynb or https://github.com/thuml/Autoformer/blob/main/scripts/Exchange_script/Autoformer.sh. Even it is not a huggingface version, but i think it can work for you to train your own model. All you have to do is to replace your dataset with the demo six datasets from here https://drive.google.com/drive/folders/1ZOYpTUa82_jCcxIdTmyr0LXQfvaM9vIy. And after all of this, i think you will meet the problem with the hyperparameters such as seq_len, label_len and pred_len, or whatever. Try to set them to fit your own dataset, and i think things will work. @Duduzao123 and @dkagramanyan. Hope this could help. Best regards.

AppleMax1992 avatar Sep 02 '23 13:09 AppleMax1992

Thanks for your interest in AutoFormer, might be useful to create a general notebook for this, cc @kashif

NielsRogge avatar Sep 03 '23 08:09 NielsRogge

Hello, I am new to huggingface, and I am trying to implement the autoformer on a financial time series with prices and other features. I can either do a binary classification or a regression. So I just tried to follow the huggingface documentation , but I am stuck at this part: outputs = model( past_values=batch["past_values"], past_time_features=batch["past_time_features"], past_observed_mask=batch["past_observed_mask"], static_categorical_features=batch["static_categorical_features"], static_real_features=batch["static_real_features"], future_values=batch["future_values"], future_time_features=batch["future_time_features"], ) I do not have categorical features, and I do not know how to put my data into the model. For a classification problem: My X is of shape (16,8) with 16 being the lookback and 8 the number of features. y is binary labels for now (0 or 1)

Can anyone help me out ? Thank you.

CaroleYoussef avatar Dec 07 '23 17:12 CaroleYoussef

@CaroleYoussef have you consulted the blog posts that came with these models? they explain the concepts for the inputs and their sizes e.g. https://huggingface.co/blog/time-series-transformers

kashif avatar Dec 07 '23 17:12 kashif