Skip to main content
added 9 characters in body
Source Link
hanugm
  • 4k
  • 3
  • 28
  • 59

Your interpretation is definitely correct. As you correctly pointed out, the derivative of $softplus$softplus is continuous and $n$-times differentiable, that makes the function smooth, which is not the case for $ReLU$ReLU.

What is quite interesting here is why $softplus$softplus can be called an approximation to $ReLU$ReLU.

If we break down the definition of $softplus$softplus, we note that the parameter $\beta$ controls the smoothness of the function. In fact, we can define a temperature $T = \frac{1}{\beta}$ (much like the softmax function). Let's denote with $f_T$ a softplus function with temperature $T$. We can easily see that as $T \rightarrow 0$ (or equivalently $\beta \rightarrow \infty$), $f_T(x) \rightarrow \max(0, x)$. In fact, let's compute the limit of the softplus for all $x > 0$:

$\lim_{\beta \rightarrow \infty} \frac{1}{\beta} ln(1 + e^{\beta x})$

Rewrite $ln(1+e^{\beta x})$ as $ln(e^{-\beta x} + 1) +ln(e^{\beta x})$ we get:

$\lim_{\beta \rightarrow \infty} \frac{1}{\beta}[ln(e^{-\beta x} + 1) +ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}[ln(0 + 1) + ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}[0 + ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}\beta x = \\ = x$

Computing the limit for $x \leq 0 $ is straightforward and the result is $0$. So we see that for high value of $\beta$ (or low value of $T$), the softplus is actually the $max(0, x)$$\max(0, x)$ function!

Therefore, softplus is a family of functions $f_T$ which approximate ReLU with high precision as $T$ gets to 0 (less smoothness), and low precision with high $T$ (more smoothness).

Among all, we usually use softplus with $beta = 1$ (i.e, $f_1$), and this is why we call it a smooth approximation of the ReLU. Because $f_1(x)$ is smooth ($T=1$) and approximates $f_\infty(x) = max(0, x) = ReLU(x)$$f_\infty(x) = \max(0, x) = \text{ReLU}(x)$.

Hope this was useful.

Your interpretation is definitely correct. As you correctly pointed out, the derivative of $softplus$ is continuous and $n$-times differentiable, that makes the function smooth, which is not the case for $ReLU$.

What is quite interesting here is why $softplus$ can be called an approximation to $ReLU$.

If we break down the definition of $softplus$, we note that the parameter $\beta$ controls the smoothness of the function. In fact, we can define a temperature $T = \frac{1}{\beta}$ (much like the softmax function). Let's denote with $f_T$ a softplus function with temperature $T$. We can easily see that as $T \rightarrow 0$ (or equivalently $\beta \rightarrow \infty$), $f_T(x) \rightarrow \max(0, x)$. In fact, let's compute the limit of the softplus for all $x > 0$:

$\lim_{\beta \rightarrow \infty} \frac{1}{\beta} ln(1 + e^{\beta x})$

Rewrite $ln(1+e^{\beta x})$ as $ln(e^{-\beta x} + 1) +ln(e^{\beta x})$ we get:

$\lim_{\beta \rightarrow \infty} \frac{1}{\beta}[ln(e^{-\beta x} + 1) +ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}[ln(0 + 1) + ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}[0 + ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}\beta x = \\ = x$

Computing the limit for $x \leq 0 $ is straightforward and the result is $0$. So we see that for high value of $\beta$ (or low value of $T$), the softplus is actually the $max(0, x)$ function!

Therefore, softplus is a family of functions $f_T$ which approximate ReLU with high precision as $T$ gets to 0 (less smoothness), and low precision with high $T$ (more smoothness).

Among all, we usually use softplus with $beta = 1$ (i.e, $f_1$), and this is why we call it a smooth approximation of the ReLU. Because $f_1(x)$ is smooth ($T=1$) and approximates $f_\infty(x) = max(0, x) = ReLU(x)$.

Hope this was useful.

Your interpretation is definitely correct. As you correctly pointed out, the derivative of softplus is continuous and $n$-times differentiable, that makes the function smooth, which is not the case for ReLU.

What is quite interesting here is why softplus can be called an approximation to ReLU.

If we break down the definition of softplus, we note that the parameter $\beta$ controls the smoothness of the function. In fact, we can define a temperature $T = \frac{1}{\beta}$ (much like the softmax function). Let's denote with $f_T$ a softplus function with temperature $T$. We can easily see that as $T \rightarrow 0$ (or equivalently $\beta \rightarrow \infty$), $f_T(x) \rightarrow \max(0, x)$. In fact, let's compute the limit of the softplus for all $x > 0$:

$\lim_{\beta \rightarrow \infty} \frac{1}{\beta} ln(1 + e^{\beta x})$

Rewrite $ln(1+e^{\beta x})$ as $ln(e^{-\beta x} + 1) +ln(e^{\beta x})$ we get:

$\lim_{\beta \rightarrow \infty} \frac{1}{\beta}[ln(e^{-\beta x} + 1) +ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}[ln(0 + 1) + ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}[0 + ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}\beta x = \\ = x$

Computing the limit for $x \leq 0 $ is straightforward and the result is $0$. So we see that for high value of $\beta$ (or low value of $T$), the softplus is actually the $\max(0, x)$ function!

Therefore, softplus is a family of functions $f_T$ which approximate ReLU with high precision as $T$ gets to 0 (less smoothness), and low precision with high $T$ (more smoothness).

Among all, we usually use softplus with $beta = 1$ (i.e, $f_1$), and this is why we call it a smooth approximation of the ReLU. Because $f_1(x)$ is smooth ($T=1$) and approximates $f_\infty(x) = \max(0, x) = \text{ReLU}(x)$.

Hope this was useful.

deleted 3 characters in body
Source Link
danin
  • 71
  • 2

Your interpretation is definitely correct. As you correctly pointed out, the derivative of $softplus$ is continuous and $n$-times differentiable, that makes the function smooth, which is not the case for $ReLU$.

What is quite interesting here is why $softplus$ can be called an approximation to $ReLU$.

If we break down the definition of $softplus$, we note that the parameter $\beta$ controls the smoothness of the function. In fact, we can define a temperature $T = \frac{1}{\beta}$ (much like the softmax function). Let's denote with $f_T$ a softplus function with temperature $T$. We can easily see that as $T \rightarrow 0$ (or equivalently $\beta \rightarrow \infty$), $f_T(x) \rightarrow \max(0, x)$. In fact, let's compute the limit of the softplus for all $x > 0$:

$\lim_{\beta \rightarrow \infty} \frac{1}{\beta} ln(1 + e^{\beta x})$

Rewrite $ln(1+e^{\beta x})$ as $ln(e^{-\beta x} + 1) +ln(e^{\beta x})$ we get:

$\lim_{\beta \rightarrow \infty} \frac{1}{\beta}[ln(e^{-\beta x} + 1) +ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}[ln(0 + 1) + ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}[0 + ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}\beta x = \\ = x$

Computing the limit for $x \leq 0 $ is straightforward and the result is $0$. So we see that for high value of $\beta$ (or low value of $T$), the softplus is actually the $max(0, x)$ function!

Therefore, softplus is a family of functions $f_T$ which approximate ReLU with high precision as $T$ gets biggerto 0 (less smoothness), and low precision with a lowhigh $T$ (more smoothness).

Among all, we usually use softplus with $beta = 1$ (i.e, $f_1$), and this is why we call it a smooth approximation of the ReLU. Because $f_1(x)$ is smooth ($T=1$) and approximates $f_\infty(x) = max(0, x) = ReLU(x)$.

Hope this was useful.

Your interpretation is definitely correct. As you correctly pointed out, the derivative of $softplus$ is continuous and $n$-times differentiable, that makes the function smooth, which is not the case for $ReLU$.

What is quite interesting here is why $softplus$ can be called an approximation to $ReLU$.

If we break down the definition of $softplus$, we note that the parameter $\beta$ controls the smoothness of the function. In fact, we can define a temperature $T = \frac{1}{\beta}$ (much like the softmax function). Let's denote with $f_T$ a softplus function with temperature $T$. We can easily see that as $T \rightarrow 0$ (or equivalently $\beta \rightarrow \infty$), $f_T(x) \rightarrow \max(0, x)$. In fact, let's compute the limit of the softplus for all $x > 0$:

$\lim_{\beta \rightarrow \infty} \frac{1}{\beta} ln(1 + e^{\beta x})$

Rewrite $ln(1+e^{\beta x})$ as $ln(e^{-\beta x} + 1) +ln(e^{\beta x})$ we get:

$\lim_{\beta \rightarrow \infty} \frac{1}{\beta}[ln(e^{-\beta x} + 1) +ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}[ln(0 + 1) + ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}[0 + ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}\beta x = \\ = x$

Computing the limit for $x \leq 0 $ is straightforward and the result is $0$. So we see that for high value of $\beta$ (or low value of $T$), the softplus is actually the $max(0, x)$ function!

Therefore, softplus is a family of functions $f_T$ which approximate ReLU with high precision as $T$ gets bigger (less smoothness), and low precision with a low $T$ (more smoothness).

Among all, we usually use softplus with $beta = 1$ (i.e, $f_1$), and this is why we call it a smooth approximation of the ReLU. Because $f_1(x)$ is smooth ($T=1$) and approximates $f_\infty(x) = max(0, x) = ReLU(x)$.

Hope this was useful.

Your interpretation is definitely correct. As you correctly pointed out, the derivative of $softplus$ is continuous and $n$-times differentiable, that makes the function smooth, which is not the case for $ReLU$.

What is quite interesting here is why $softplus$ can be called an approximation to $ReLU$.

If we break down the definition of $softplus$, we note that the parameter $\beta$ controls the smoothness of the function. In fact, we can define a temperature $T = \frac{1}{\beta}$ (much like the softmax function). Let's denote with $f_T$ a softplus function with temperature $T$. We can easily see that as $T \rightarrow 0$ (or equivalently $\beta \rightarrow \infty$), $f_T(x) \rightarrow \max(0, x)$. In fact, let's compute the limit of the softplus for all $x > 0$:

$\lim_{\beta \rightarrow \infty} \frac{1}{\beta} ln(1 + e^{\beta x})$

Rewrite $ln(1+e^{\beta x})$ as $ln(e^{-\beta x} + 1) +ln(e^{\beta x})$ we get:

$\lim_{\beta \rightarrow \infty} \frac{1}{\beta}[ln(e^{-\beta x} + 1) +ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}[ln(0 + 1) + ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}[0 + ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}\beta x = \\ = x$

Computing the limit for $x \leq 0 $ is straightforward and the result is $0$. So we see that for high value of $\beta$ (or low value of $T$), the softplus is actually the $max(0, x)$ function!

Therefore, softplus is a family of functions $f_T$ which approximate ReLU with high precision as $T$ gets to 0 (less smoothness), and low precision with high $T$ (more smoothness).

Among all, we usually use softplus with $beta = 1$ (i.e, $f_1$), and this is why we call it a smooth approximation of the ReLU. Because $f_1(x)$ is smooth ($T=1$) and approximates $f_\infty(x) = max(0, x) = ReLU(x)$.

Hope this was useful.

Source Link
danin
  • 71
  • 2

Your interpretation is definitely correct. As you correctly pointed out, the derivative of $softplus$ is continuous and $n$-times differentiable, that makes the function smooth, which is not the case for $ReLU$.

What is quite interesting here is why $softplus$ can be called an approximation to $ReLU$.

If we break down the definition of $softplus$, we note that the parameter $\beta$ controls the smoothness of the function. In fact, we can define a temperature $T = \frac{1}{\beta}$ (much like the softmax function). Let's denote with $f_T$ a softplus function with temperature $T$. We can easily see that as $T \rightarrow 0$ (or equivalently $\beta \rightarrow \infty$), $f_T(x) \rightarrow \max(0, x)$. In fact, let's compute the limit of the softplus for all $x > 0$:

$\lim_{\beta \rightarrow \infty} \frac{1}{\beta} ln(1 + e^{\beta x})$

Rewrite $ln(1+e^{\beta x})$ as $ln(e^{-\beta x} + 1) +ln(e^{\beta x})$ we get:

$\lim_{\beta \rightarrow \infty} \frac{1}{\beta}[ln(e^{-\beta x} + 1) +ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}[ln(0 + 1) + ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}[0 + ln(e^{\beta x})] = \\ = \lim_{\beta \rightarrow \infty} \frac{1}{\beta}\beta x = \\ = x$

Computing the limit for $x \leq 0 $ is straightforward and the result is $0$. So we see that for high value of $\beta$ (or low value of $T$), the softplus is actually the $max(0, x)$ function!

Therefore, softplus is a family of functions $f_T$ which approximate ReLU with high precision as $T$ gets bigger (less smoothness), and low precision with a low $T$ (more smoothness).

Among all, we usually use softplus with $beta = 1$ (i.e, $f_1$), and this is why we call it a smooth approximation of the ReLU. Because $f_1(x)$ is smooth ($T=1$) and approximates $f_\infty(x) = max(0, x) = ReLU(x)$.

Hope this was useful.