-
Notifications
You must be signed in to change notification settings - Fork 393
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
Workflow independent model loading #274
Conversation
Codecov Report
@@ Coverage Diff @@
## master #274 +/- ##
==========================================
+ Coverage 86.51% 86.56% +0.05%
==========================================
Files 329 335 +6
Lines 10617 10748 +131
Branches 334 567 +233
==========================================
+ Hits 9185 9304 +119
- Misses 1432 1444 +12
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #274 +/- ##
===========================================
- Coverage 86.35% 57.02% -29.34%
===========================================
Files 319 319
Lines 10431 10454 +23
Branches 345 550 +205
===========================================
- Hits 9008 5961 -3047
- Misses 1423 4493 +3070
Continue to review full report at Codecov.
|
…TransmogrifAI into mt/function-arguments-merged
…TransmogrifAI into mt/function-arguments-merged
…function-arguments-merged
…TransmogrifAI into mt/function-arguments-merged
Can anyone please review this PR? |
features/src/test/scala/com/salesforce/op/stages/base/binary/BinaryTransformerTest.scala
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments / questions:
- Right now both model loading methods exist, correct? (eg. we can still load with a workflow with lambdas as we always have?)
- Do you think we should we explicitly deprecate the old way, or leave it around forever?
- Should we also update the helloworld examples since they use lambdas? Or do you think we should leave them as is since they're not saving/loading models?
- There are also many examples where we use UnaryLambdaTransformers in tests, but don't save models (eg. BadFeatureZooTest). Do you think we should change all of those too, or just the ones that result in saved models?
If you think we should do either of the last two items, I'm fine with them being in separate PRs since this one is already enormous.
|
- replace lambdas with concrete classes according to #274 - fix typos
Thanks for the contribution! Before we can merge this, we need @wsuchy to sign the Salesforce.com Contributor License Agreement. |
Related issues
Following up on #269 - a sequence of PRs on allowing model loading without workflows...
Describe the proposed solution
1.
This PR finally allows loading models without recreating the workflow by simply calling:
Importantly the old syntax (i.e.
workflow.loadModel(path)
), still works as before.With this change we are going to be serializing all transformers and feature generator instances, then reconstructing them when loading the model without requiring the original workflow.
Of course updated all the tests with the changes.
Migration Notes
All lamdba transformers and extract functions cannot neither be inline nor have external dependencies on variables. Functions are now required to be specified in objects (Scala 2.11) and as concrete classes for Scala 2.12 and up. Example:
2.
Additionally one can now provide a custom reader/writer for each transformer stage if necessary as follows:
Here is a full example for our own TextTokenizer stage.