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

how can I train without a val_set? thanks #671

Closed
jarvis1890 opened this issue Feb 9, 2023 · 3 comments
Closed

how can I train without a val_set? thanks #671

jarvis1890 opened this issue Feb 9, 2023 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@jarvis1890
Copy link

No description provided.

@oguiza
Copy link
Contributor

oguiza commented Feb 14, 2023

Hi @jarvis1890,
Both fastai and tsai are built with the idea of using a validation set.
However, there's an easy hack you can use, and it's to pass [0] as your validation split and disregard the validation metrics. Here's an example of how this could work:

from tsai.basics import *
X, y, _ = get_UCR_data('LSST', split_data=False)
splits = (np.arange(len(y)), [0])
tfms = [None, TSClassification()]
batch_tfms = TSStandardize(by_sample=True)
dls = get_ts_dls(X, y, splits=splits, tfms=tfms, batch_tfms=batch_tfms)
learn = ts_learner(dls, metrics=accuracy, cbs=[ShowGraph()], train_metrics=True)
learn.fit_one_cycle(10, 1e-2)

@oguiza oguiza added the question Further information is requested label Feb 14, 2023
@oguiza oguiza added the enhancement New feature or request label Mar 14, 2023
@oguiza
Copy link
Contributor

oguiza commented Mar 14, 2023

I've modified the dataloaders so you no longer need to pass a validation or test set. You can just pass any of the following:

  • a single train_split
  • a tuple: (train_split, )
  • a tuple: (train_split, None)
  • a tuple: (train_split, [])

@oguiza
Copy link
Contributor

oguiza commented Mar 14, 2023

I'll close this issue due to the lack of response.

@oguiza oguiza closed this as completed Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants