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 a way to override layer choices #35

Closed
odow opened this issue Jun 9, 2024 · 0 comments · Fixed by #46
Closed

Add a way to override layer choices #35

odow opened this issue Jun 9, 2024 · 0 comments · Fixed by #46

Comments

@odow
Copy link
Collaborator

odow commented Jun 9, 2024

We need a generic way to override layer choices. This is particularly important for Gurobi to be able to opt-in to sigmoid/max constraints, and to be able to swap out ReLU formulations in a NN.

I currently have a hacky config argument in (F)lux, but that doesn't translate to GLM etc.

    historical_df = read_df("college_student_enroll-s1-1.csv")
    model_glm = GLM.glm(
        GLM.@formula(enroll ~ 0 + merit + SAT + GPA),
        historical_df,
        GLM.Bernoulli(),
    )
    application_df = read_df("college_applications6000.csv")
    n_students = size(application_df, 1)
    model = Model(Gurobi.Optimizer)
    set_silent(model)
    application_df.merit = @variable(model, 0 <= x_merit[1:n_students] <= 2.5)
    application_df.enroll = MathOptAI.add_predictor(
        model,
        model_glm,
        application_df,
        MathOptAI.Sigmoid() => Gurobi.Sigmoid(),  # How???
    )
@odow odow changed the title A way to override layer choices Add a way to override layer choices Jun 10, 2024
@odow odow closed this as completed in #46 Jun 10, 2024
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 a pull request may close this issue.

1 participant