Skip to content

Commit c0ec791

Browse files
authored
Update Losses.jl
Update double def
1 parent af62dc2 commit c0ec791

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/Losses.jl

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,6 @@ function r2_score_floor(y_true::AbstractArray{T}, y_pred::AbstractArray{T}) wher
158158

159159
return r2_score(y_true_scaled, y_pred_scaled)
160160
end
161-
162-
163-
164-
function mean_squared_error(y_true::AbstractArray{T}, y_pred::AbstractArray{T}) where T<:AbstractFloat
165-
d::T = zero(T)
166-
@assert length(y_true) == length(y_pred)
167-
@fastmath @inbounds @simd for i in eachindex(y_true, y_pred)
168-
temp = (y_true[i]-y_pred[i])
169-
d += temp*temp
170-
end
171-
return d/length(y_true)
172-
end
173161

174162
function mean_squared_error(y_true::AbstractArray{T}, y_pred::AbstractArray{T}) where T<:AbstractFloat
175163
d::T = zero(T)
@@ -179,8 +167,7 @@ function mean_squared_error(y_true::AbstractArray{T}, y_pred::AbstractArray{T})
179167
d += temp*temp
180168
end
181169
return d/length(y_true)
182-
end
183-
170+
end
184171

185172
function root_mean_squared_error(y_true::AbstractArray{T}, y_pred::AbstractArray{T}) where T<:AbstractFloat
186173
d::T = zero(T)

0 commit comments

Comments
 (0)