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

Add support of missing values for L2Loss #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amostof
Copy link

@amostof amostof commented Sep 19, 2023

No description provided.

@ChrisRackauckas
Copy link
Member

Can you add a test?

@@ -50,14 +50,14 @@ function (f::L2Loss)(sol::DiffEqBase.AbstractNoTimeSolution)

if weight == nothing
@inbounds for i in 1:length(sol)
sumsq += (data[i] - sol[i])^2
sumsq += (coalesce(data[i] - sol[i], 0))^2
Copy link
Member

Choose a reason for hiding this comment

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

use zero of the same type as elements

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