Learn R Programming

nnR (version 0.1.0)

comp: comp

Description

The function that takes the composition of two neural networks assuming they are compatible, i.e., given \(\nu_1, \nu_2 \in \mathsf{NN}\), it must be the case that \(\mathsf{I}(\nu)_1 = \mathsf{O}(\nu_2)\).

Usage

comp(phi_1, phi_2)

phi_1 %comp% phi_2

Value

The composed neural network. See also dep.

Our definition derive specifically from:

Arguments

phi_1

first neural network to be composed, goes on the left

phi_2

second neural network to be composed, goes on right

References

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

Remark: We have two versions of this function, an infix version for close resemblance to mathematical notation and prefix version.

Examples

Run this code
create_nn(c(5, 4, 6, 7)) |> comp(create_nn(c(4, 1, 5)))

Run the code above in your browser using DataLab