completion labo 6 - #1
Open
joey-van-melle wants to merge 2 commits into
Open
joey-van-melle wants to merge 2 commits into
joey-van-melle wants to merge 2 commits into
Conversation
Author
|
Labo 6 |
dpo
reviewed
Aug 18, 2025
|
Status: |
dpo
reviewed
Aug 19, 2025
|
|
||
| function projected_gradient_norm(x, gx, C) | ||
| y = copy(x) | ||
| projection!(y .= x .- gx, C) |
Contributor
There was a problem hiding this comment.
Un peu risqué et perte de lisibilité ; en gros, ce n'est pas une bonne pratique.
| g_0 = grad(model, x0) | ||
| gx = copy(g_0) | ||
| g0norm = projected_gradient_norm(x0, g_0, C) | ||
| gnorm = projected_gradient_norm(x, gx, C) |
|
|
||
| return GenericExecutionStats(model; status=status, solution = x, | ||
| objective = obj(model, x), | ||
| primal_feas = NaN, |
| return GenericExecutionStats(model; status=status, solution = x, | ||
| objective = obj(model, x), | ||
| primal_feas = NaN, | ||
| dual_feas = NaN, |
|
|
||
| @info log_header([:iter, :nf, :primal, :nd, :Δ], | ||
| [Int, Int, Float64, String, Float64, Float64], | ||
| hdr_override=Dict(:nf => "#F", :primal => "f(x)", :nd => "‖d‖", :Δ => "‖Δf‖")) |
Contributor
There was a problem hiding this comment.
Ce serait important d'afficher gnorm puisque c'est la mesure de stationnarité ...
| iter_limit = iter > max_iter | ||
| tired = many_evals || el_time > max_time || iter_limit | ||
|
|
||
| @info log_row(Any[iter, neval_obj(model), fvalue, pnorm, gnorm]) |
Contributor
There was a problem hiding this comment.
Tu affiches gnorm dans une colonne qui s'appelle ∆f ...
| end | ||
| ``` | ||
|
|
||
| Dans les trois cas, on arrive à convergé mais la solution n'est pas aussi bonne que Ipopt de plusieurs degrés de magnitures. |
Contributor
There was a problem hiding this comment.
Ce n'est pas très facile de comparer les solutions dans la sortie de ton code.
| x .= center .+ v .* (r / nv) | ||
| return x | ||
| end | ||
| end |
|
|
||
| # Votre solution pourrait-elle être utilisée pour calculer un pas dans une méthode de région de confiance ? | ||
| Oui en fait, elle retourne exactement s. Le problème de cette méthode c'est qu'elle n'est pas optimale en ce sens où elle aura de la | ||
| difficulté à prendre une direction optimale lorsque le problème n'est pas convexe. Ainsi, la méthode peut être lente. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.