Skip to content

Commit

Permalink
feat: Updated the tests to include the full evidential regression loss.
Browse files Browse the repository at this point in the history
  • Loading branch information
DoktorMike committed May 5, 2022
1 parent 3733528 commit 76b9108
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,15 @@ using Test
# y = 1 * sin.(x[1, :]) .- 3 * sin.(x[2, :]) .+ 2 * cos.(x[3, :]) .+ randn(Float32, 91)
y = 1 * x[1, :] .- 3 * x[2, :] .+ 2 * x[3, :] .+ randn(Float32, 91)
#scatterplot(x[1, :], y, width = 90, height = 30)
#loss(y, ŷ) = sum(abs, y - ŷ)
pars = Flux.params(m)
opt = ADAMW(0.005)
trnlosses = zeros(Float32, 1000)
for i in 1:1000
local trnloss
grads = Flux.gradient(pars) do
= m(x)
γ = ŷ[1, :]
trnloss = loss(y, γ)
γ, ν, α, β = ŷ[1, :], ŷ[2, :], ŷ[3, :], ŷ[4, :]
trnloss = sum(nignll(y, γ, ν, α, β, 0.1, 1e-4))
end
trnlosses[i] = trnloss
# Test that we can update the weights based on gradients
Expand Down

0 comments on commit 76b9108

Please sign in to comment.