Internals
NeuralLyapunov.phi_to_net — Function
phi_to_net(phi, θ[; idx])Return the network as a function of state alone.
Arguments
phi: the neural network, represented asphi(x, θ)if the neural network has a single output, or aVectorof the same with one entry per neural network output.θ: the parameters of the neural network; If the neural network has multiple outputs,θ[:φ1]should be the parameters of the first neural network output,θ[:φ2]the parameters of the second (if there are multiple), and so on. If the neural network has a single output,θshould be the parameters of the network.idx: the neural network outputs to include in the returned function; defaults to all and only applicable whenphi isa Vector.
NeuralLyapunov.NeuralLyapunovBenchmarkLogger — Type
NeuralLyapunovBenchmarkLogger(losses, iterations)A simple logger for tracking the (full weighted) loss during training using NeuralPDE.
Fields
losses::Vector{<:Real}: A vector to store the loss values.iterations::Vector{<:Integer}: A vector to store the corresponding iteration numbers.
Constructors
NeuralLyapunovBenchmarkLogger{T1, T2}() where {T1<:Real, T2<:Integer}: Creates an empty logger with specified types for losses and iterations.NeuralLyapunovBenchmarkLogger{T}() where {T}: Creates an empty logger with specified type for losses andInt64for iterations.NeuralLyapunovBenchmarkLogger(): Creates an empty logger withFloat64for losses andInt64for iterations.
NeuralLyapunov.AbstractNeuralLyapunovStructure — Type
AbstractNeuralLyapunovStructure{nc}Represents the structure of the neural Lyapunov function and its derivative.
All concrete AbstractNeuralLyapunovStructure subtypes should define the get_V, get_V̇, and get_network_dim functions. If nc is true, the subtype should also define the get_control_structure and get_control_dim functions.
NeuralLyapunov.get_V — Function
get_V(str::AbstractNeuralLyapunovStructure)Return a function V(phi, state, fixed_point) that outputs the value of the Lyapunov function at state.
NeuralLyapunov.get_V̇ — Function
get_V̇(str::AbstractNeuralLyapunovStructure)Return a function V̇(phi, J_phi, state, dstate_dt, fixed_point) that outputs the time derivative of the Lyapunov function at state.
NeuralLyapunov.neural_controller — Function
neural_controller(str::AbstractNeuralLyapunovStructure)Return true if str specifies a neural controller (i.e., if str is a subtype of AbstractNeuralLyapunovStructure{true}) and false otherwise.
NeuralLyapunov.get_network_dim — Function
get_network_dim(str::AbstractNeuralLyapunovStructure)Return the number of dimensions of the neural network output specified by spec.
NeuralLyapunov.get_control_dim — Function
get_control_dim(str::AbstractNeuralLyapunovStructure{true})Return the control dimension specified by spec.
NeuralLyapunov.get_control_structure — Function
get_control_structure(str::AbstractNeuralLyapunovStructure{true})Return the control structure specified by spec.