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

bug fixes in QP backend #90

Merged
merged 2 commits into from
May 5, 2021
Merged

bug fixes in QP backend #90

merged 2 commits into from
May 5, 2021

Conversation

akshay326
Copy link
Collaborator

@codecov
Copy link

codecov bot commented Apr 25, 2021

Codecov Report

Merging #90 (8ec37e6) into master (99bd415) will increase coverage by 0.09%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #90      +/-   ##
==========================================
+ Coverage   81.50%   81.59%   +0.09%     
==========================================
  Files           5        5              
  Lines         865      864       -1     
==========================================
  Hits          705      705              
+ Misses        160      159       -1     
Impacted Files Coverage Δ
src/MOI_wrapper.jl 79.61% <0.00%> (+0.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 99bd415...8ec37e6. Read the comment docs.

@akshay326
Copy link
Collaborator Author

I see a major feature requirement (thanks to cvxpylayer), i.e. ability to track gradients (if we can somehow pass a TrackedArray instead of an array in a JuMP model). This allows fine-grained control of differentiating a function, which can be a composition of variables and tracked problem data (such as a loss) directly.

@matbesancon
Copy link
Collaborator

matbesancon commented Apr 25, 2021 via email

@@ -347,12 +347,12 @@ end

function MOI.get(model::Optimizer,
::ForwardIn{QuadraticObjective}, vi1::VI, vi2::VI)
tuple = ifelse(index(vi1) <= index(vi2), (vi1, vi2), (vi2, vi1))
tuple = ifelse(vi1.value <= vi2.value, (vi1, vi2), (vi2, vi1))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why changing this one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was failing on my device, on Julia 1.0

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one thing to note: tuple is also a Julia function in Base, maybe try to use a name that is not already defined to avoid tricky bugs

@@ -871,7 +871,7 @@ function _fill_quad_Q(model, dQv, dQi, dQj, index_map)
for ((vi1, vi2), val) in dict_dQ
i = index_map[vi1].value
j = index_map[vi2].value
for (vi, val) in dict
for (vi, val) in dict_dQ
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok this is weird that this wasn't caught by tests before

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joaquimg should there be a test where dict_dQ gets used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep. i guess with more examples common, such bugs (if any) will surface

@matbesancon
Copy link
Collaborator

@be-apt since this PR seems to be focused on the small bug fixes, maybe we should rename it and open something for the regression examples?

@akshay326 akshay326 changed the title Sensitivity Analysis Ridge Regression bug fixes in QP backend May 3, 2021
@akshay326
Copy link
Collaborator Author

is this good to go?

@matbesancon
Copy link
Collaborator

rename the tuple variables to something else and good to go

@matbesancon matbesancon merged commit cc09140 into master May 5, 2021
@matbesancon matbesancon deleted the ridge_regress branch May 5, 2021 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants