Skip to content

Conversation

@BernhardAhrens
Copy link
Collaborator

make losses losses

@lazarusA
Copy link
Member

lazarusA commented Nov 24, 2025

I was thinking that maybe we should just called them metrics or similar. We want to track performance with these... performance_metrics? But this will be breaking.

l_init_train,
l_init_val,
training_loss,
loss_types[1],
Copy link
Member

@lazarusA lazarusA Nov 25, 2025

Choose a reason for hiding this comment

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

I don't know how I feel about this. I thinks this is already breaking :/

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it is not breaking - it is just for the trainboard. The default behavior stays the same (training_loss = :mse, loss_types = [:mse, :r2])

# one minus nse
function loss_fn(ŷ, y, y_nan, ::Val{:nse})
return sum((ŷ[y_nan] .- y[y_nan]).^2) / sum((y[y_nan] .- mean(y[y_nan])).^2)
return one(eltype(ŷ)) - (sum((ŷ[y_nan] .- y[y_nan]).^2) / sum((y[y_nan] .- mean(y[y_nan])).^2))
Copy link
Member

Choose a reason for hiding this comment

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

oh yes, it should be like this for a proper loss.

return one(eltype(ŷ)) .- (cor(ŷ[y_nan], y[y_nan]))
end

function loss_fn(ŷ, y, y_nan, ::Val{:nseLoss})
Copy link
Member

@lazarusA lazarusA Nov 25, 2025

Choose a reason for hiding this comment

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

maybe this is only ::Val{:nse} and the next one is the actual :Val{:nseLoss}.

@BernhardAhrens
Copy link
Collaborator Author

I was thinking that maybe we should just called them metrics or similar. We want to track performance with these... performance_metrics? But this will be breaking.

Yes, performance_metrics would be good. This would be indeed breaking - maybe my proposed changes are also breaking. We could have performance_metrics where the highest value gives the best performance (NSE) and what we have so far returns the model with lowest metric. So at the moment the train function would only work with losses (decreasing)

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.

3 participants