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

Adjusting builds for TadGAN #261

Closed
sarahmish opened this issue Dec 22, 2021 · 5 comments · Fixed by #262
Closed

Adjusting builds for TadGAN #261

sarahmish opened this issue Dec 22, 2021 · 5 comments · Fixed by #262
Assignees
Labels
enhancement Improvements on the current features
Milestone

Comments

@sarahmish
Copy link
Collaborator

sarahmish commented Dec 22, 2021

  • Orion version: 0.2.0
  • Python version: 3.7
  • Operating System: macOS 10.15.6

Description

In the current version of TadGAN, we build the model with every fit call

self._build_tadgan(**kwargs)

When we can to continue training, we do not necessarily need to rebuild the model. To fix this issue, we can introduce a flag to indicate if/when to build the model

if build:
    self._augment_hyperparameters(X, y, kwargs)
    self._set_shapes()
    self._build_tadgan(**kwargs)

self._fit(X, y)

EDIT

Rather than using a build parameter, make "rebuilding" a model not possible. If the user wishes to "rebuild" a model then they can create a new Orion instance.

Changes to reflect this is

if not self._fitted:
    self._augment_hyperparameters(X, y, kwargs)
    self._set_shapes()
    self._build_tadgan(**kwargs)

self._fit(X, y)
self._fitted = True
@NIckyVNYC
Copy link

By "flag" do you mean to add a parameter as to the number of files to use to train and then only call "build" if the number of files have been gone through before the model is built?

@sarahmish
Copy link
Collaborator Author

@NIckyVNYC this is an internal improvement.

From the end-user perspective and after creating an instance orion = Orion('tadgan') you would have two options:

  1. orion.fit(data) which operates as usual and only builds the model once. As such, each time you call orion.fit you will refit the same model.
  2. orion.fit(data, build=True) which ensures that the model is build in that run. Meaning, if every time you call fit with build=True you are fitting another model.

@NIckyVNYC
Copy link

Thank you Sarah, is that the fix for Tadgan? I tried putting the "build=True" into the program and it said the keyword "build" is an error. Do I need to download and update Orion-ML? or is that fix not yet in Orion-ML? Best, Nicholas V.

@sarahmish
Copy link
Collaborator Author

Hi @NIckyVNYC, we are still working on this fix! You can follow the issue to know when it will be part of the new release!

@NIckyVNYC
Copy link

Dear Sarah, I see you closed this issue and released a new master. Question, if you remember my problem which was this issue was that I wanted to train Tadgan model on many different files where each file has about 18,000 rows of time stamps and values in the 2nd column. Before, every time it when to a new file to train epochs after about 100 files, it would take more than 1/2 hour for it to get to the next file, when at the beginning it would just take 6 minutes between the 1st and 2nd file (using a cpu). And it would exponentially increasing time with each file. I assume you fixed the problem. Above you say one can either use orion.fit(data) or orion.fit(data, build=True). I am confused as to which one to use if I want my model to train on thousands of files but not have the training take more time between each file. Do I use the build=True? But if I am fitting another model, what does that mean? If I pick that and train on thousands of different files, will the be thousands of different models? I assume I pick that so it want continue taking more time increasing between each file? And also, now that its a master, if I update the orion-ml I assume it will have that fix, right? . Thanks. Nicholas.

@sarahmish sarahmish self-assigned this Feb 18, 2022
@sarahmish sarahmish added this to the 0.2.1 milestone Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements on the current features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants