Learn R Programming

nnR (version 0.1.0)

slm: slm

Description

The function that returns the left scalar multiplication neural network

Usage

slm(a, nu)

a %slm% nu

Value

Returns a neural network that is \(a \triangleright \nu\). This instantiates as \(a \cdot f(x)\) under continuous function activation. More specifically we define operation as:

Let \(\lambda \in \mathbb{R}\). We will denote by \((\cdot) \triangleright (\cdot): \mathbb{R} \times \mathsf{NN} \rightarrow \mathsf{NN}\) the function satisfying for all \(\nu \in \mathsf{NN}\) and \(\lambda \in \mathbb{R}\) that \(\lambda \triangleright \nu = \mathsf{Aff}_{\lambda \mathbb{I}_{\mathsf{I}(\nu)},0} \bullet \nu\).

Arguments

a

A real number.

nu

A neural network of the type generated by create_nn().

References

Definition 2.3.4. Jentzen, A., Kuckuck, B., and von Wurstemberger, P. (2023). Mathematical introduction to deep learning: Methods, implementations, and theory. https://arxiv.org/abs/2310.20360.

Note: We will have two versions of this operation, a prefix and an infix version.

Examples

Run this code

5 |> slm(Prd(2.1, 0.1))
Prd(2.1, 0.1) |> srm(5)

Run the code above in your browser using DataLab