stem/AI/Neural Networks/Activation Functions.md
andy 25f73797e3 vault backup: 2023-05-27 23:02:51
Affected files:
.obsidian/graph.json
.obsidian/workspace.json
STEM/AI/Neural Networks/Activation Functions.md
STEM/AI/Neural Networks/CNN/CNN.md
STEM/AI/Neural Networks/CNN/FCN/FCN.md
STEM/AI/Neural Networks/CNN/FCN/FlowNet.md
STEM/AI/Neural Networks/CNN/FCN/Highway Networks.md
STEM/AI/Neural Networks/CNN/FCN/ResNet.md
STEM/AI/Neural Networks/CNN/FCN/Skip Connections.md
STEM/AI/Neural Networks/CNN/GAN/DC-GAN.md
STEM/AI/Neural Networks/CNN/GAN/GAN.md
STEM/AI/Neural Networks/CNN/UpConv.md
STEM/img/highway-vs-residual.png
STEM/img/imagenet-error.png
STEM/img/resnet-arch.png
STEM/img/resnet-arch2.png
STEM/img/skip-connections 1.png
STEM/img/upconv-matrix-result.png
STEM/img/upconv-matrix-transposed-result.png
STEM/img/upconv-matrix.png
STEM/img/upconv-transposed-matrix.png
STEM/img/upconv.png
2023-05-27 23:02:51 +01:00

1.4 KiB

  • Limits output values
  • Squashing function

Threshold

  • For binary functions
  • Not differentiable
    • Sharp rise
  • Heaviside function
  • Unipolar
    • 0 <-> +1
  • Bipolar
    • -1 <-> +1

!threshold-activation.png

Sigmoid

  • Logistic function
  • Normalises
  • Introduces non-linearity
  • Alternative is tanh
    • -1 <-> +1
  • Easy to take derivative
\frac d {dx} \sigma(x)=
\frac d {dx} \left[ 
\frac 1 {1+e^{-x}}
\right]
=\sigma(x)\cdot(1-\sigma(x))$$

![[sigmoid.png]]
### Derivative

$$y_j(n)=\varphi_j(v_j(n))=
\frac 1 {1+e^{-v_j(n)}}$$
$$\frac{\partial y_j(n)}{\partial v_j(n)}=
\varphi_j'(v_j(n))=
\frac{e^{-v_j(n)}}{(1+e^{-v_j(n)})^2}=
y_j(n)(1-y_j(n))$$
- Nice derivative
- Max value of $\varphi_j'(v_j(n))$ occurs when $y_j(n)=0.5$
- Min value of 0 when $y_j=0$ or $1$
- Initial [[Weight Init|weights]] chosen so not saturated at 0 or 1

If $y=\frac u v$
Where $u$ and $v$ are differential functions

$$\frac{dy}{dx}=\frac d {dx}\left(\frac u v\right)$$

$$\frac{dy}{dx}=
\frac {v \frac d {dx}(u) - u\frac d {dx}(v)} {v^2}$$

# ReLu
Rectilinear
- For deep networks
- $y=max(0,x)$
- CNNs
	- Breaks associativity of successive [[convolution]]s
		- Critical for learning complex functions
	- Sometimes small scalar for negative
		- Leaky ReLu

![[relu.png]]

# SoftMax
- Output is per-class vector of likelihoods
	- Should be normalised into probability vector

## AlexNet
$$f(x_i)=\frac{\text{exp}(x_i)}{\sum_{j=1}^{1000}\text{exp}(x_j)}$$