Training on Simple Loss gives error: No method matching +(::Float64, ::Array{Float64, 2})

y needs to be a row vector and you don’t have to broadcast it

function loss(θ)
    y = (-5:0.1:5)'
    windspeeds = U(y, θ)
    truewinds = y.^2 #example
    return sum(abs2, (windspeeds .- truewinds))
end
2 Likes