Skip to content

Remise labo 3 - #6

Open
oihanc wants to merge 2 commits into
dpo-mth8408:mainfrom
oihanc:test-branch
Open

oihanc wants to merge 2 commits into
dpo-mth8408:mainfrom
oihanc:test-branch

Conversation

@oihanc

@oihanc oihanc commented Jun 27, 2025

Copy link
Copy Markdown

No description provided.

@github-actions

Copy link
Copy Markdown

Status:
Success--Here-is-the-PDF

Comment thread rapport.qmd
# votre code ici
# Package to do LDL factorization (required for the modified Newton implementation)
Pkg.add("LDLFactorizations")
using LDLFactorizations

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mets ces instructions dans la cellule au-dessus pour qu'on ne voie pas la sortie.

Comment thread rapport.qmd
# Source: https://www.cs.nthu.edu.tw/~cherung/teaching/2011cs5321/handout3.pdf (slide 8/20)
# Could be vectorized for improved performance.
for i in 1:size(LDL.D, 1)
LDL.D[i, i] = max(LDL.D[i, i], delta)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, mais on a vu comment faire en labo.

Comment thread rapport.qmd

# For stability purposes -> normalize the descent direction if large
dk_norm = norm(dk)
if dk_norm > 1.0e2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Là, tu détruis la direction de Newton car un pas t = 1 le long de la direction normalisée n'est plus un pas de Newton...

Comment thread rapport.qmd
alphak = 1.0
fk = obj(model, xk)

for i in 1:50

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

et si on atteint i = 50, que se passe-t-il ?

Comment thread rapport.qmd
Hk .= hess(model, xk)

# For local superlinear convergence (Nocedal, page 168)
eta_k = min(0.5, sqrt(norm_gk))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

Comment thread rapport.qmd
eta_k = min(0.5, sqrt(norm_gk))
eps_k = eta_k*norm_gk

zj = zeros(dim)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On ne demande PAS d'implémenter CG ...

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.

2 participants