Skip to content

Commit

Permalink
add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Nov 4, 2023
1 parent 11e312a commit c472329
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,25 @@ function Base.oftype(x::Number, y::AbstractArray)
y[]
end

"""
rms(x)
Root mean square of `x`.
"""
rms(x::AbstractVector) = sqrt(mean(abs2, x))

"""
sse(x)
Sum of squares of `x`.
"""
sse(x::AbstractVector) = x x

"""
mse(x)
Mean square of `x`.
"""
mse(x::AbstractVector) = sse(x) / length(x)
mse(x::AbstractMatrix) = sum(abs2, x, dims=2) ./ size(x, 2)

Expand Down

0 comments on commit c472329

Please sign in to comment.