Since neural networks are universal function approximators, I am interested to know if a neural network with a simple activation function be used to approximate $\sin(x)$ Assuming the input is bounded.
2026-03-27 12:03:57.1774613037
What kind of neural network be used to approximate sin(x) function?
699 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There are 1 best solutions below
Related Questions in NEURAL-NETWORKS
- Retrain of a neural network
- Angular values for input to a neural network
- Smooth, differentiable loss function 'bounding' $[0,1]$
- How to show that a gradient is a sum of gradients?
- Approximation rates of Neural Networks
- How does using chain rule in backprogation algorithm works?
- Computing the derivative of a matrix-vector dot product
- Need to do an opposite operation to a dot product with non square matrices, cannot figure out how.
- Paradox of square error function and derivates in neural networks
- Momentum in gradient descent
Related Questions in NETWORK
- On the Hex/Nash connection game theorem
- minimal number of edges for a graph of size N so that there are two paths between any pair of nodes
- what is mean "Number of connected Triplets of vertices" in global clustering
- What is this "logarithmic golden ratio of scale-free networks" really called?
- Are there textbooks or resources on the mathematics of networks?
- Proving an inequality when a graph is not connected
- Probability of at least two bits
- Probability in terms of slots wasted during network contention
- Network Science: Terminology for graphs with different kinds of edges
- Number of Spanning Trees With A Relation to Contraction of Graph
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
With ReLU nodes, it is quite straight-forward to make triangular waves. For instance, if you have a layer of hidden nodes given by $$ \begin{align} a&: x\mapsto R(x)\\ b&: x\mapsto R(x-1)\\ c&: x\mapsto R(x-2) \end{align} $$ (where $R$ is the ReLU function) and then combine them like so in the output node: $$ a -2b + c $$ then this gives a function which is flat to the right of $0$, then goes straight up to the point $(1, 1)$, then straight down to $(2, 0)$, and from there it's flat. Which is to say, a single triangle with base along the $x$-axis of length $2$ and height $1$.
The main insight is that this triangle may be moved and scaled appropriately by changing the input linearly or scaling the output. For instance, $$ \begin{align} a&: x\mapsto R(x)\\ b&: x\mapsto R\left(x-\frac\pi2\right)\\ c&: x\mapsto R(x-\pi) \end{align} $$ and changing the output node to $$ \frac2\pi(a-2b+c) $$ gives you a triangle that aligns with the first half of a sine wave. Similarly, you can make a triangle for the second half of the sine wave, add them together, and get this result. Which is a good start.
So, if we want to do better, what can we do? Well, let's look at what's left. In other words, the difference between what we want and what we have. Here is a WolframAlpha plot of that. How can we fix this? More triangles!
This time we need four triangles. And at this stage we can choose our approach a little. Note that the waves here aren't completely symmetrical, so the maxima and minima aren't smack in the middle of the zeroes. Do we keep using symmetric triangles? That would make our expressions and our job a bit easier. If so, how tall do we make them? Or do we make triangles whose maximum coincides with the maximum of what we're after? Or maybe there is some other "best triangle fit" to look for.
I'll go for the symmetric triangles, with peak at the same height as the extrema. The first triangle is thus given by $$ \begin{align} d&: x\mapsto R(x)\\ e&: x\mapsto R\left(x-\frac\pi4\right)\\ f&: x\mapsto R\left(x-\frac\pi2\right) \end{align} $$ and to our output node we now add $$ 0.26803432(d - 2e + f) $$ to account for the first wave. And we can make similar triangles for the remaining waves. Unfortunately, WolframAlpha won't let me plot the result of all of them, so here is a plot using only the first of these four. You can see how we're already really closing in on the sine graph.
Speaking of choosing better-fitting triangles, though, maybe we should look for a better fit in the original two triangles as well? Perhaps using $0.8105695$ as a scaling constant in the output node is a truer approximation than $\frac2\pi$, as the two waves now have approximately the same area. Or maybe we want the maximal difference between the values to be as small as possible, rather than the areas as equal as possible? In that case, we want to use $0.724611$ as a scaling factor.