Learn R Programming

nnR (version 0.1.0)

is_nn: is_nn

Description

Function to create a list of lists for neural network layers

Usage

is_nn(nn)

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:

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.

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

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

Run the code above in your browser using DataLab