
The function that returns the
Etr(n, h)
An approximation for value of the integral of a function. Must be instantiated
with a list of
number of trapezoids to make. Note this will result in a set of trapezoids. A natural number.
width of trapezoids. A positive real number.
Note: Upon instantiation with any continuous function this neural
network must be fed with
Definition 2.33. 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
Etr(5, 0.1)
seq(0, pi, length.out = 1000) |> sin() -> samples
Etr(1000 - 1, pi / 1000) |> inst(ReLU, samples)
seq(0, 2, length.out = 1000)^2 -> samples
Etr(1000 - 1, 2 / 1000) |> inst(Tanh, samples)
Run the code above in your browser using DataLab