diff --git a/examples/Project.toml b/examples/Project.toml index 4642652e..803aa899 100644 --- a/examples/Project.toml +++ b/examples/Project.toml @@ -15,4 +15,4 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [compat] -julia = "1.9" +julia = "1.6" diff --git a/src/misc.jl b/src/misc.jl index 75f53c9d..624c6a91 100644 --- a/src/misc.jl +++ b/src/misc.jl @@ -52,7 +52,7 @@ function transferFlatParams!(net, p_net, c=1; netRange=nothing) netRange = 1:length(net.layers) end for l in netRange - if !isa(net.layers[l], Dense) + if !isa(net.layers[l], Flux.Dense) continue end ni = size(net.layers[l].weight,2) @@ -86,7 +86,7 @@ function transferParams!(net, p_net, c=1; netRange=nothing) netRange = 1:length(net.layers) end for l in netRange - if !(net.layers[l] isa Dense) + if !(net.layers[l] isa Flux.Dense) continue end diff --git a/src/neural.jl b/src/neural.jl index 6998b888..d0b050d3 100644 --- a/src/neural.jl +++ b/src/neural.jl @@ -301,7 +301,7 @@ function f_optim(x, nfmu::ME_NeuralFMU, c::FMU2Component, right_x_fmu) # , idx, # propagete the new state-guess `x` through the NeuralFMU evaluateModel(nfmu, c, x) #indicators = fmi2GetEventIndicators(c) - return Flux.Losses.mse(right_x_fmu, fmi2GetContinuousStates(c)) # - min(-direction*indicators[idx], 0.0) + return Flux.Losses.mae(right_x_fmu, fmi2GetContinuousStates(c)) # - min(-direction*indicators[idx], 0.0) end # Handles the upcoming event