is_nn {nnR}R Documentation

is_nn

Description

Function to create a list of lists for neural network layers

Usage

is_nn(nn)

Arguments

nn

A neural network. Neural networks are defined to be an ordered list of ordered pairs of (W,b). Where W is the matrix representing the weight matrix W at that layer and b the bias vector.

Value

TRUE or FALSE on whether nn is indeed a neural network as defined above.

We will use the definition of neural networks as found in:

References

Definition 2.1 in Rafi S., Padgett, J.L., Nakarmi, U. (2024) Towards an Algebraic Framework For Approximating Functions Using Neural Network Polynomials https://arxiv.org/abs/2402.01058

Which in turn is a modified version of the one found in:

Definition 2.3. Grohs, P., Hornung, F., Jentzen, A. et al. Space-time error estimates for deep neural network approximations for differential equations. (2019). https://arxiv.org/abs/1908.03833.

Examples

create_nn(c(5, 6, 7)) |> is_nn()
Sqr(2.1, 0.1) |> is_nn()


[Package nnR version 0.1.0 Index]