Problem 58882. Neural Nets: Activation functions
Return values of selected Activation function type for value,vector, and matrices.
y=Activation(x,id); where id is 1:4 for ReLU, sigmoid, hyperbolic_tan, Softmax
ReLU: Rectified Linear Unit, clips negatives max(0,x) Trains faster than sigmoid
Sigmoid: Exponential normalization [0:1] ![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJEAAAAnCAYAAAAPS6pLAAAFo0lEQVR4Xu2bSeseRRDGkw8g4vIJooKCEMFEQfQiuMZbFE0iIiiuJ8ENl0MwEc1F8OACHnIwqEguguICCi4XNxS8uRxUPLniB9DnB1NhHHupfnvemf+b6YaHP0kv01X9dHVVdb/bt7XSNFCpge2V/Vv3poFtjUSNBNUaaCSqVmEboJGocaBaA3OS6CbN/j3ht2op2gCzamAuEu2Q1N8LFwhfOzRwhtpcL7zoaNua1GmgeHPPRaI7Jeftwm6HvBDomPCQk3COIVuThAZ2qu7pEn2XkggL8tcIR9BnGuMlh2WBQG93hPNYLNMNiihp31j1Xw2gv+PCXo8evSSCPPcLdwveIyi2MEzwK+Es4YfM6kGg94UjzlW+VO0eEy4STnf2ac3CGkCXzwhX54xGjkRYgic68tinakl0WANd2E0utYAPqvIO4WzHKpsJvqpr+0cj0f+0xlpeIdwqoKd9wqsC6/GI8JqAP9Qv1OO7PppagxSJrlXH84VvhIPCrm6gWhJ9p3GwFkwwVhD4W+GeTDv641+d2s3zZf09TWgkiusWC/NRR5ovu2bvdH+HLoAFQJep/uPYkDlLZP2wCjhblBoSmQBnapxUaF9ihfqycfyxy9ZFItNDaNcm9sSWq/qnm5FHDnT6pzC0UieEmppEz3VfxsKkyu+qfF5ImtHAAEsgkRHAw8wnIzo0PXkMAuR5RYj6sFOTCHLcLLyV0ADH6JvCnky70BBLIBHW3Fv+VsNQlMpmJkjy6NiOtLvUPpinm5JEMJrJ56Imc/RyR97JTiKChVOEX4RcFOslFe0g4dHOssQs1XA8Nv+7QvBIm5JELk9fEzVr4p1bX+BNt0SWSmGxOM6vFAhovIudI5P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aHFhY/xLzQKbDe+g/quAAAAAElFTkSuQmCC)
HyperTan: Normalization[-1:1] tanh(x)
Softmax: Normalizes output sum to 1, individual values [0:1]
Used on Output node
Working though a series of Neural Net challenges from Perceptron, Hidden Layers, Back Propogation, ..., to the Convolutional Neural Net/Training for Handwritten Digits from Mnist.
Might take a day or two to completely cover Neural Nets in a Matlab centric fashion.
Essentially Out=Softmax(ReLU(X*W)*WP)
Solution Stats
Problem Comments
-
1 Comment
Richard Zapor
on 21 Aug 2023
Multi-Case Softmax should be y=exp(x)./sum(exp(x),2)
Solution Comments
Show commentsProblem Recent Solvers9
Suggested Problems
-
Find common elements in matrix rows
2627 Solvers
-
given 3 sides, find area of this triangle
794 Solvers
-
Similar Triangles - find the height of the tree
293 Solvers
-
600 Solvers
-
Test if two numbers have the same digits
241 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!