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

local_loss should call increment obj #16

Open
tmigot opened this issue Jul 12, 2023 · 3 comments
Open

local_loss should call increment obj #16

tmigot opened this issue Jul 12, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@tmigot
Copy link
Member

tmigot commented Jul 12, 2023

function local_loss(nlp::AbstractFluxNLPModel{T, S}, x, y, w::AbstractVector{T}) where {T, S}

or have some specific counters.

@tmigot tmigot added the enhancement New feature or request label Jul 12, 2023
@farhadrclass
Copy link
Collaborator

@tmigot would it be possible to explain more

@tmigot
Copy link
Member Author

tmigot commented Oct 31, 2023

It felt like this function is actually evaluating the objective function, and is sometimes called without update of counters

@farhadrclass
Copy link
Collaborator

I agree,
Also in objgrad!, can we improve this?

 x, y = nlp.current_training_minibatch
  f_w = nlp.loss_f(nlp.chain(x), y)
  g .= gradient(w_g -> local_loss(nlp, x, y, w_g), w)[1]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants