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

Questions about Standardization/Normalization preprocessing with tfms and batch_tfms #898

Open
jeffabc1997 opened this issue May 3, 2024 · 0 comments

Comments

@jeffabc1997
Copy link

jeffabc1997 commented May 3, 2024

Hi, I'm new to timeseriesAI.
Data should be normalized before we fit the model.
For instance, I have data [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]. [1, ..., 8] should be normalized, so 8 would be 1, 9 would be 1.143 after transformation.
When I apply the code in tutorial notebook, does batch_tfms=[TSNormalize()] normalize all data(1, ....,8 in my case) or just normalize the data in 1 batch?

X, y = SlidingWindow(window_length, horizon=horizon, get_x=df.columns[:-1], get_y='label')(df)
splits = get_splits(y, n_splits=1, test_size=0.2,shuffle=False, check_splits=True)
tfms = [None, [Categorize()]]
dsets = TSDatasets(X, y, tfms = tfms, splits=splits, inplace=True)
dls = TSDataLoaders.from_dsets(dsets.train, dsets.valid, bs=[2, 4], batch_tfms=[TSNormalize()], num_workers=0)

I did some research and someone says that batch_tfms let the GPU do the work, but I don't think I really understand the concept.

Another question is that how can I see the data after transformation? I use show_batch() but I don't know which batch is showing.
Edit: using xb, yb = dls.train.one_batch()seems to see only 1 batch?

Thanks!

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

1 participant