RobustNeuralNetworks.direct_to_explicit
RobustNeuralNetworks.get_lipschitz
RobustNeuralNetworks.init_states
RobustNeuralNetworks.set_output_zero!
RobustNeuralNetworks.update_explicit!
Functions
RobustNeuralNetworks.direct_to_explicit
— Functiondirect_to_explicit(ps::AbstractRENParams{T}, return_h=false) where T
Convert direct parameterisation of RENs to explicit parameterisation.
Uses the parameterisation encoded in ps
to construct an ExplicitRENParams
object that naturally satisfies a set of user-defined behavioural constraints.
Arguments
ps::AbstractRENParams
: Direct parameterisation with behavioural constraints to convert to an explicit parameterisation of REN (eg:GeneralRENParams
).return_h::Bool=false
: Whether to return the H-matrix directly (see Revay et al. (2021)). Useful for debugging or model analysis. Iffalse
, function returns an object of typeExplicitRENParams{T}
.
See also GeneralRENParams
, ContractingRENParams
, LipschitzRENParams
, PassiveRENParams
.
direct_to_explicit(ps::AbstractRENParams{T}) where T
Convert direct parameterisation of LBDNs to explicit parameterisation.
Uses the parameterisation encoded in ps
to construct an ExplicitLBDNParams
object that naturally respects a user-defined Lipschitz bound.
Arguments
ps::AbstractLBDNParams
: Direct parameterisation of an LBDN to convert to an explicit parameterisation for model evaluation (eg:DenseLBDNParams
).
See also DenseLBDNParams
.
RobustNeuralNetworks.get_lipschitz
— Functionget_lipschitz(model)
Extract Lipschitz bound from a Lipschitz-bounded model
Returns Lipschitz bound as a float. Function only works on the following types:
LBDN
andDiffLBDN
DenseLBDNParams
andDirectLBDNParams
LipschitzRENParams
RobustNeuralNetworks.init_states
— Functioninit_states(m::AbstractREN, nbatches; rng=nothing)
Return matrix of (nbatches) state vectors of a REN initialised as zeros.
RobustNeuralNetworks.set_output_zero!
— Functionset_output_zero!(m::AbstractRENParams)
Set output map of a REN to zero.
If the resulting model is called with
ren = REN(m)
x1, y = ren(x, u)
then y = 0
for any x
and u
.
set_output_zero!(m::AbstractLBDNParams)
Set output map of an LBDN to zero.
If the resulting model is called with
lbdn = LBDN(m)
y = lbdn(u)
then y = 0
for any u
.
RobustNeuralNetworks.update_explicit!
— Functionupdate_explicit!(m::WrapREN)
Update explicit model in WrapREN
using the current direct parameters.