A perceptron contains 2 phases:
- weighted sum function (ideally linear) - calculate a “weighted sum” of its input and its bias/constant
- activation function (ideally non-linear) - then decide whether it should be “fired” or not
- synonymous to non-linear layer
Weighted Sum Function
- outputs a 𝑧 value ranging from (-∞ to +∞)
- doesn’t have a builtin mechanism whether to fire the perceptron or not, this is why we have activation functions
example weighted sum function
Indent
𝑧 = [𝛴1≤𝑖≤𝑛(𝑤𝑒𝑖𝑔ℎ𝑡𝑖* 𝑖𝑛𝑝𝑢𝑡𝑖)] + [𝑤𝑒𝑖𝑔ℎ𝑡0 * 𝑏𝑖𝑎𝑠/𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡]
𝑧 = [𝛴1≤𝑖≤𝑛(𝑤𝑖* 𝑥𝑖)] + [𝑤0 * 𝑥0]
𝑧 = [𝛴0≤𝑖≤𝑛(𝑤𝑖* 𝑥𝑖)]
𝑧 = 𝑤𝑇𝑥
Independent Activation Functions
---cognitive-computing---machine-intelligence/ai---subfields/machine-learning-(ml)---pattern-recognition/ml---models/artificial-neural-networks-(ann)/perceptrons-(artificial-neurons)/activation-functions-(af)/perceptron.png)
there are various types of activation functions each with there pros and cons
|
AF |
Output Function |
Output Range |
Pros |
Cons |
|---|---|---|---|---|
|
𝑓(𝑧) = 1, if 𝑧 > threshold |
0 or 1 |
| ||
|
𝑓(𝑧) = 𝑐𝑧 for some scalar 𝑐 |
(-inf, +inf) |
| ||
|
𝑓(𝑧) = 1/(1+𝑒-𝑧) |
(0, 1) |
|
| |
|
𝑓(𝑧) = 𝑡𝑎𝑛ℎ(𝑧) = 2 𝑠𝑖𝑔𝑚𝑜𝑖𝑑(2𝑧) - 1 |
(-1, 1) |
|
| |
|
𝑓(𝑧) = 𝑚𝑎𝑥(0, 𝑧) |
[0, +inf) |
|
| |
|
𝑓(𝑧) = 𝑙𝑜𝑔(1+𝑒𝑧) |
(0, +inf) |
Dependent Activation Functions
|
Activation Function |
Output Function |
Output Range |
Description |
|---|---|---|---|
where: 𝑧 is some element in set 𝐳 for example, 𝐳=[2,-1,3]:
|
[0, 1] |
|