Library Functions
FMIFlux.CS_NeuralFMU
FMIFlux.FMUParameterRegistrator
FMIFlux.FMUTimeLayer
FMIFlux.LossAccumulationScheduler
FMIFlux.ME_NeuralFMU
FMIFlux.NeuralFMU
FMIFlux.ParameterRegistrator
FMIFlux.RandomScheduler
FMIFlux.ScaleShift
FMIFlux.SequentialScheduler
FMIFlux.ShiftScale
FMIFlux.SimultaniousZeroCrossing
FMIFlux.WorstElementScheduler
FMIFlux.WorstGrowScheduler
FMIFlux.fmi2EvaluateME
FMIFlux.fmi2InputDoStepCSOutput
FMIFlux.fmiDoStepCS
FMIFlux.fmiEvaluateME
FMIFlux.fmiInputDoStepCSOutput
FMIFlux.mse_interpolate
FMIFlux.transferFlatParams!
FMIFlux functions
FMIFlux.CS_NeuralFMU
— TypeStructure definition for a NeuralFMU, that runs in mode Co-Simulation
(CS).
FMIFlux.ME_NeuralFMU
— TypeStructure definition for a NeuralFMU, that runs in mode Model Exchange
(ME).
FMIFlux.NeuralFMU
— TypeThe mutable struct representing an abstract (simulation mode unknown) NeuralFMU.
FMI 2 version dependent functions
FMIFlux.fmiDoStepCS
— FunctionDEPRECATED:
Wrapper. Call fmi2DoStepCS
for more information.
FMIFlux.fmi2EvaluateME
— FunctionDEPRECATED:
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.
FMIFlux.fmi2InputDoStepCSOutput
— FunctionDEPRECATED:
fmi2InputDoStepCSOutput(comp::FMU2Component,
dt::Real,
u::Array{<:Real})
Sets all FMU inputs to u
, performs a ´´´fmi2DoStep´´´ and returns all FMU outputs.
FMI version independent functions
FMIFlux.fmiEvaluateME
— FunctionDEPRECATED:
Wrapper. Call fmi2EvaluateME
for more information.
FMIFlux.fmiInputDoStepCSOutput
— FunctionDEPRECATED:
Wrapper. Call fmi2InputDoStepCSOutput
for more information.
Additional functions
FMIFlux.mse_interpolate
— FunctionCompares non-equidistant (or equidistant) datapoints by linear interpolating and comparing at given interpolation points t_comp
. (Zygote-friendly: Zygote can differentiate through via AD.)
transferParams!
TODO: Sort docs
FMIFlux.LossAccumulationScheduler
— TypeComputes 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)
FMIFlux.transferFlatParams!
— FunctionWrites/Copies flatted (Flux.destructure) training parameters p_net
to non-flat model net
with data offset c
.
FMIFlux.WorstElementScheduler
— TypeComputes all batch element losses. Picks the batch element with the greatest loss as next training element.
FMIFlux.FMUParameterRegistrator
— TypeToDo.
FMIFlux.SimultaniousZeroCrossing
— TypeForces a simultaniuos zero crossing together with a given value by function.
FMIFlux.ParameterRegistrator
— TypeToDo.
FMIFlux.ScaleShift
— TypeToDo.
FMIFlux.WorstGrowScheduler
— TypeComputes all batch element losses. Picks the batch element with the greatest grow in loss (derivative) as next training element.
FMIFlux.SequentialScheduler
— TypeSequentially runs over all elements.
FMIFlux.FMUTimeLayer
— TypeA neutral layer that calls a function fct
with current FMU time as input.
FMIFlux.ShiftScale
— TypeToDo.
FMIFlux.RandomScheduler
— TypePicks a random batch element as next training element.