Library Functions
FMIFlux.CS_NeuralFMUFMIFlux.FMUParameterRegistratorFMIFlux.FMUTimeLayerFMIFlux.LossAccumulationSchedulerFMIFlux.ME_NeuralFMUFMIFlux.NeuralFMUFMIFlux.ParameterRegistratorFMIFlux.RandomSchedulerFMIFlux.ScaleShiftFMIFlux.SequentialSchedulerFMIFlux.ShiftFMIFlux.ShiftScaleFMIFlux.SimultaniousZeroCrossingFMIFlux.TwoStageRandomSchedulerFMIFlux.WorstElementSchedulerFMIFlux.WorstGrowSchedulerFMIFlux.Losses.mse_interpolateFMIFlux.fmi2EvaluateMEFMIFlux.fmi2InputDoStepCSOutputFMIFlux.fmiDoStepCSFMIFlux.fmiEvaluateMEFMIFlux.fmiInputDoStepCSOutput
FMIFlux functions
FMIFlux.CS_NeuralFMU — Type
Structure definition for a NeuralFMU, that runs in mode Co-Simulation (CS).
FMIFlux.ME_NeuralFMU — Type
Structure definition for a NeuralFMU, that runs in mode Model Exchange (ME).
FMIFlux.NeuralFMU — Type
The mutable struct representing an abstract (simulation mode unknown) NeuralFMU.
FMI 2 version dependent functions
FMIFlux.fmiDoStepCS — Function
DEPRECATED:
Wrapper. Call fmi2DoStepCS for more information.
FMIFlux.fmi2EvaluateME — Function
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.
FMIFlux.fmi2InputDoStepCSOutput — Function
DEPRECATED:
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 — Function
DEPRECATED:
Wrapper. Call fmi2EvaluateME for more information.
FMIFlux.fmiInputDoStepCSOutput — Function
DEPRECATED:
Wrapper. Call fmi2InputDoStepCSOutput for more information.
Additional functions
FMIFlux.Losses.mse_interpolate — Function
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.)
TODO: Sort docs
FMIFlux.LossAccumulationScheduler — Type
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)FMIFlux.TwoStageRandomScheduler — Type
Picks a random batch element by doing the following two steps:
- given a vector (a) of vectors (b), a random vector from (a) is picked
- a random value from the random vector (b) is pickedFMIFlux.WorstElementScheduler — Type
Computes all batch element losses. Picks the batch element with the greatest loss as next training element.FMIFlux.FMUParameterRegistrator — Type
ToDo.
FMIFlux.SimultaniousZeroCrossing — Type
Forces a simultaniuos zero crossing together with a given value by function.
FMIFlux.ParameterRegistrator — Type
ToDo.
FMIFlux.ScaleShift — Type
ToDo.
FMIFlux.Shift — Type
ToDo.Shifts input signals.
FMIFlux.WorstGrowScheduler — Type
Computes all batch element losses. Picks the batch element with the greatest grow in loss (derivative) as next training element.FMIFlux.SequentialScheduler — Type
Sequentially runs over all elements.FMIFlux.FMUTimeLayer — Type
A neutral layer that calls a function fct with current FMU time as input.
FMIFlux.ShiftScale — Type
ToDo.Shifts and scales input data to a given distribution
FMIFlux.RandomScheduler — Type
Picks a random batch element as next training element.