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

152 simple minvar experiment #153

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

tschm
Copy link
Collaborator

@tschm tschm commented Oct 20, 2023

No description provided.

@tschm tschm linked an issue Oct 20, 2023 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Oct 20, 2023

Pull Request Test Coverage Report for Build 6598319586

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 94.4%

Totals Coverage Status
Change from base Build 6555923264: 0.0%
Covered Lines: 472
Relevant Lines: 500

💛 - Coveralls

@tschm
Copy link
Collaborator Author

tschm commented Oct 20, 2023

@kasperjo @phschiele
I am working on a l little talk about new cvxpy. I came across a few issues

@tschm
Copy link
Collaborator Author

tschm commented Oct 20, 2023

Is this still a thing?
/Users/a13069q/github/cvxmarkowitz/.venv/lib/python3.10/site-packages/cvxpy/reductions/solvers/solving_chain.py:235: UserWarning: Your problem has too many parameters for efficient DPP compilation. We suggest setting 'ignore_dpp = True'.

@tschm
Copy link
Collaborator Author

tschm commented Oct 20, 2023

        x = cp.Variable(n)
        L = cp.Parameter((n, n))

        objective = cp.Minimize(cp.norm2(L.T @ x))
        constraints = [cp.sum(x) == 1, x >= 0]

        prob = cp.Problem(objective, constraints)

How would I compile the problem now?

@tschm
Copy link
Collaborator Author

tschm commented Oct 21, 2023

Ok, diving deeper into cvxpy:

def f2():
    U = uu
    x = cp.Variable(n)

    objective = cp.Minimize(cp.norm2(U @ x))
    constraints = [cp.sum(x) == 1, x >= 0]
    prob = cp.Problem(objective, constraints)

    data, solving_chain, inverse_data = prob.get_problem_data(
        solver
    )
    print(data)

    solution = solving_chain.solve_via_data(
        prob, data)

    prob.unpack_results(solution, solving_chain, inverse_data)
    return prob.value

I wonder how can I update data without calling prob.get_problem_data. I update values for one or all parameters. But when hitting solve it still runs self.get_problem_data?

@phschiele
Copy link
Collaborator

@tschm We did not remove the warning for a large number of parameters (yet)

You can call

    data, solving_chain, inverse_data = prob.get_problem_data(
        solver
    )

to canonicalise the problem ahead of time.

Then you just update the parameters and call solve. It will automatically use the cached canonicalisation map.

@tschm
Copy link
Collaborator Author

tschm commented Oct 21, 2023

How can I change the backend to RUST? It tells me it is still using CPP backend...
@phschiele Time for Zoom call today or tomorrow?

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.

Simple MinVar experiment
2 participants