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

Add Scale predictor #89

Merged
merged 3 commits into from
Aug 28, 2024
Merged

Add Scale predictor #89

merged 3 commits into from
Aug 28, 2024

Conversation

odow
Copy link
Collaborator

@odow odow commented Aug 28, 2024

Closes #87

cc @pulsipher

@odow
Copy link
Collaborator Author

odow commented Aug 28, 2024

@pulsipher how do you normally interact with this in OMLT? Do you manually choose the values of offset and factor?

@pulsipher
Copy link

See my comment in #87.

With OMLT I have manually input these which is analogous to manually specifying the weights for a dense layer, but at least this meant I didn't always have to copy and paste the same lines of code for the transformation each time.

However, as pointed out in #87, I much rather embed the preprocessing layer in the trained model and then have the scaling automatically taken care of when the predictor is built in MathOptAI. This helps avoid modelling errors and streamlines the code. Moreover, it is more practical since the data preprocessing will likely happen in Python, while MathOptAI is naturally in Julia, so accessing the scaling parameters will be more cumbersome.

@odow odow changed the title Add OffsetScaling predictor Add Scale predictor Aug 28, 2024
@odow
Copy link
Collaborator Author

odow commented Aug 28, 2024

Okay. This PR now implements MathOptAI.Scale(scale, bias), and it adds support for Flux.Scale and Lux.Scale.

@odow odow merged commit b6df21a into main Aug 28, 2024
@odow odow deleted the od/OffsetScaling branch August 28, 2024 03:17
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

Successfully merging this pull request may close these issues.

Add OffsetScaling predictor
2 participants