RobustNeuralNetworks.jl

A Julia package for robust neural networks.
Author acfr
Popularity
11 Stars
Updated Last
1 Year Ago
Started In
September 2022

RobustNeuralNetworks.jl

Build Status

A Julia package for robust neural networks built from the Recurrent Equilibrium Network (REN) and Lipschitz-Bounded Deep Network (LBDN) model classes. Please visit the docs page for detailed documentation

Installation

To install the package, type the following into the REPL.

] add RobustNeuralNetworks

You should now be able to construct robust neural network models. The following example constructs a contracting REN and evalutates it given a batch of random initial states x0 and inputs u0.

using Random
using RobustNeuralNetworks

# Setup
rng = MersenneTwister(42)
batches = 10
nu, nx, nv, ny = 4, 2, 20, 1

# Construct a REN
contracting_ren_ps = ContractingRENParams{Float64}(nu, nx, nv, ny; rng=rng)
ren = REN(contracting_ren_ps)

# Some random inputs
x0 = init_states(ren, batches; rng=rng)
u0 = randn(rng, ren.nu, batches)

# Evaluate the REN over one timestep
x1, y1 = ren(x0, u0)

println(round.(y1;digits=2))

The output should be:

[-31.41 0.57 -0.55 -3.56 -35.0 -18.28 -25.48 -7.49 -4.14 15.31]

Contact

Please contact Nic Barbara (nicholas.barbara@sydney.edu.au) with any questions.

Used By Packages

No packages found.