1

I want to know why we use $(1+e^{\text{something}})^{-1}$ for artificial intelligence. I know $e$ is just $2.7$.

So what? Why $2.7$ and not $3$?

Does it have a special property?

YoTengoUnLCD
  • 13,384

2 Answers2

2

The number $e^{\text{something}}$ can always be written as $3^{\text{something else}}$, where “something” and “something else” only differ by a constant factor ($\ln(3)$, to be precise). So it doesn't really matter what base you use for your exponentials. It's just that $e^x$ is much more convenient when computing derivatives, for example. And almost all programming languages already have a function for computing $e^x$, typically called exp(x), so don't write your own implementation!

Hans Lundmark
  • 53,395
  • Too late! I'm debugging it now. I wrote my own Euler's number script and my own factorial loop (that I don't think has been written the way I did). So I have literally made the whole process of AI transparent for math geeks like myself :D – tylerl-uxai Apr 22 '16 at 10:28
1

You can see $e$ as the unique real number such that $$ \ln (e)=1 $$ giving $$ e=2.71828182845904523536028747135266249775724709370\ldots. $$ One may prove that $$ \ln(e^x)=x, \quad x \in \mathbb{R}, $$$$ e^{\ln (x)}=x, \quad x \in (0,\infty), $$$$ \frac{d}{dx}e^x =e^x \quad x \in \mathbb{R}, $$ $$ e^x =\sum_{n=0}^\infty\frac{x^n}{n!}\quad x \in \mathbb{R}. $$

Olivier Oloa
  • 120,989
  • 1
    This doesn't answer the "why $e$ and not $3$?" – YoTengoUnLCD Apr 22 '16 at 01:28
  • 1
    It does. We have $\ln 3=1.09\ldots>1$, thus $3$ can't be $e$. – Olivier Oloa Apr 22 '16 at 01:30
  • hahaha YoTengoUnLCD is such a smart ass... I love this answer @Olivier Oloa!! I'm going to keep playing with this to compute e out manually in my network – tylerl-uxai Apr 22 '16 at 01:32
  • That last part looks familiar. I wonder why they use n factorial in the bottom? – tylerl-uxai Apr 22 '16 at 01:34
  • I suppose you should add that $\ln x := \int_1^x t^{-1}, \mathrm{d}t$ (else, if you use the more usual definition, $\ln x = \exp^{-1}$, this is rather circular). – YoTengoUnLCD Apr 22 '16 at 01:34
  • @tylerl-uxai Excuse me? – YoTengoUnLCD Apr 22 '16 at 01:34
  • 1
    Yo are you trying to boss people around who are trying to learn? – tylerl-uxai Apr 22 '16 at 01:35
  • 1
    @tylerl-uxai What? I don't see where you got that from. – YoTengoUnLCD Apr 22 '16 at 01:37
  • 1
    Please keep the discussion clean. – Michael Burr Apr 22 '16 at 01:38
  • @tylerl-uxai why the factorial in the bottom of $e^x = \sum\limits_{n=0}^\infty \frac{x^n}{n!}$ follows either from the definition of $e^x$ or from Taylor's Theorem (depending on how you originally define $e$). Ahlfors defines $e^z$ as the unique solution to the differential equation $f'(z)=f(z)$ with the initial value $f(0)=1$ from which the result follows almost immediately. – JMoravitz Apr 22 '16 at 01:42
  • Ah, my mistake. I'm really sorry for saying the a word! – tylerl-uxai Apr 22 '16 at 01:42
  • @JMoravitz I hope it's ok I keep asking a lot of questions on this stack overflow. I just am really curious. Here's the formula you gave plus the neural network "activation function". Maybe you can help me understand why we don't just use a huge formula like the n!. It seems like n! will be perfect for computation when we start using atoms instead of electrons. And at that point we'll want to be precise with math... instead of using 2.7 we'll want to plug in the precise derivative of euler's number, which is what I'm aiming for http://math.stackexchange.com/questions/1753592/how-does-this-work – tylerl-uxai Apr 22 '16 at 01:44
  • 1
    sorry but I don't think you have the level yet for understanding neural networks, you should try to study first matrices (linear algebra), calculus (derivatives integrals), etc... – reuns Apr 22 '16 at 02:27
  • and you should go on stackoverflow instead, read the already answered questions, they will tell you what you need to learn for understanding machine learning when you are not a "mathematician". – reuns Apr 22 '16 at 02:29
  • Wow, you actually have more digits of $e$ in this question than I have memorized. :D – Simply Beautiful Art Apr 23 '16 at 00:20