Skip to content

Commit

Permalink
fixed examples issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ThummeTo committed Nov 16, 2023
1 parent 5d5cab6 commit 369b289
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[compat]
julia = "1.9"
julia = "1.6"
4 changes: 2 additions & 2 deletions src/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/neural.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 369b289

Please sign in to comment.