In the context of neural networks and cryptography, I would like to approximate some activation functions. However, I need to approximate them into polynomial forms for my purpose.

It seems that chebyshev polynomial approximation is the more suited one for my case, but while I read in some papers that we can enlarge the approximation for a bigger interval, all the algorithms i've seen throughout the web only mention the case $[-1,1]$...

So how do we compute this process to get a polynomial approximation of a function given an interval $[a,b]$ (the interval can be considered as $[-a,a]$ if it is easier)

If some of you have a clue to this, I would be very grateful! Thank you

  • $\begingroup$ Let $\phi: [-1, 1] \to [a, b]$ be the bijection given by $x \mapsto \frac{b - a}{2}x + \frac{b + a}{2}$. It is simply an affine transformation given by scaling and translation. Then $f \circ \phi$ would be a $[0, 1] \to \mathbb{R}$ function. Now apply your approximation, you get some $[0, 1] \to \mathbb{R}$ approximation function, call it $\overline{f \circ \phi}$. Finally, applying $\phi^{-1}$ gives $\phi^{-1} \circ \overline{f \circ \phi}$ which is a $[a, b] \to \mathbb{R}$ approximation function. Does it work for you? $\endgroup$ – Alex Vong Dec 8 '18 at 7:17
  • $\begingroup$ I haven't tried yet but it should definitely work! Thank you very much! $\endgroup$ – Robin S. Dec 8 '18 at 8:32
  • $\begingroup$ Glad it helped! $\endgroup$ – Alex Vong Dec 8 '18 at 9:21
  • $\begingroup$ I actually have an issue (sorry i didn't mention it earlier...) I want to approximate the sigmoid function, but on the interval [-8,8] roughly.. Given what you told me, the bijection is only x maps to 8x, but when I compute the approximation polynomial to sigmoid(8x), and then apply the inverse of our scaling, I basically get the approximation polynomial of the usual sigmoid (hence effective only really close to 1)... Did I miss something? $\endgroup$ – Robin S. Dec 14 '18 at 7:07
  • $\begingroup$ I understand what's wrong now. I wrote $\phi^{-1} \circ \overline{f \circ \phi}$ but in fact it should be $\overline{f \circ \phi} \circ \phi^{-1}$. Does the approximation work now? $\endgroup$ – Alex Vong Dec 14 '18 at 13:19

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.