Library Functions

FMIFlux functions

FMI 2 version dependent functions

FMIFlux.fmi2EvaluateMEFunction

DEPRECATED:

Performs something similar to fmiDoStep for ME-FMUs (note, that fmiDoStep is for CS-FMUs only). Event handling (state- and time-events) is supported. If you don't want events to be handled, you can disable event-handling for the NeuralFMU nfmu with the attribute eventHandling = false.

Optional, additional FMU-values can be set via keyword arguments setValueReferences and setValues. Optional, additional FMU-values can be retrieved by keyword argument getValueReferences.

Function takes the current system state array ("x") and returns an array with state derivatives ("x dot") and optionally the FMU-values for getValueReferences. Setting the FMU time via argument t is optional, if not set, the current time of the ODE solver around the NeuralFMU is used.

source
FMIFlux.fmi2InputDoStepCSOutputFunction

DEPRECATED:

fmi2InputDoStepCSOutput(comp::FMU2Component, 
                        dt::Real, 
                        u::Array{<:Real})

Sets all FMU inputs to u, performs a ´´´fmi2DoStep´´´ and returns all FMU outputs.

source

FMI version independent functions

Additional functions

FMIFlux.mse_interpolateFunction

Compares non-equidistant (or equidistant) datapoints by linear interpolating and comparing at given interpolation points t_comp. (Zygote-friendly: Zygote can differentiate through via AD.)

source

transferParams!

TODO: Sort docs

FMIFlux.LossAccumulationSchedulerType
Computes all batch element losses. Picks the batch element with the greatest accumulated loss as next training element. If picked, accumulated loss is resetted.
(Prevents starvation of batch elements with little loss)
source
FMIFlux.WorstGrowSchedulerType
Computes all batch element losses. Picks the batch element with the greatest grow in loss (derivative) as next training element.
source