-
-
Notifications
You must be signed in to change notification settings - Fork 194
Convert activation functions to numpower #381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.0
Are you sure you want to change the base?
Changes from all commits
4f22784
392e5ab
6a152f2
9d8c5ce
394c2a6
479f851
e5151a5
6134448
c528e87
ac32b87
0438747
af4f899
f44a597
7c7c999
d405dbd
f3371fe
fab36f4
9cfdba6
1e6b857
797da3d
3bb5166
cb4aa27
5a15240
e95ed9c
58b0ca5
764647b
344a765
0caa2f2
12ceaa4
c4fc62e
9271ecb
e1314b0
3d113a5
0dc6bcf
13c9c40
1120aee
0b80dc2
9e20e55
7851ffd
977a606
d5976d1
62ea359
5272f21
ac5a359
f517914
0a93aa1
6ce5406
31f646b
90e4495
18817d2
4b796ce
81ccd8c
0a30675
86be3a7
1b3d739
06bd4fc
fcfc9e4
0052750
4b438ac
56ca6e3
2a5012b
619b7d0
854433a
451dd2a
868830b
43fb507
e16b4a4
c3f6530
287ec5f
eef5c57
cd980ea
d80916e
0025293
45361aa
31a6e10
2872f1f
eb864c2
5203c0a
ed71ea5
b0ce0ff
c84319e
de4ef87
6dd013f
6020364
e278894
87cb3b9
edb02d0
6c4d9f4
39cb8a0
fac54d0
2c2af8a
6239d26
fc7f11e
be0b9ff
2bbfd3c
5c2adf7
7b0479a
9119f26
62f7af1
7b220c6
d05d9bf
a8c311b
c777bc0
512719f
5a1d2c4
ed7610c
e02bfe5
dda3c71
4dd363e
32087ae
99a4ccd
8992e18
e6a6143
1cbad5c
9e4a6b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
path: ./ | ||
jobs: 10 | ||
cache-dir: runtime/.phplint.cache/ | ||
extensions: | ||
- php | ||
exclude: | ||
- vendor/ | ||
- runtime/ |
SkibidiProduction marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,35 @@ | ||
<span style="float:right;"><a href="https://github.com/RubixML/ML/blob/master/src/NeuralNet/ActivationFunctions/ELU.php">[source]</a></span> | ||
<span style="float:right;"><a href="https://github.com/RubixML/ML/blob/master/src/NeuralNet/ActivationFunctions/ELU/ELU.php">[source]</a></span> | ||
|
||
# ELU | ||
*Exponential Linear Units* are a type of rectifier that soften the transition from non-activated to activated using the exponential function. As such, ELU produces smoother gradients than the piecewise linear [ReLU](relu.md) function. | ||
|
||
$$ | ||
{\displaystyle ELU = {\begin{cases}\alpha \left(e^{x}-1\right)&{\text{if }}x\leq 0\\x&{\text{if }}x>0\end{cases}}} | ||
\text{ELU}(x) = | ||
\begin{cases} | ||
SkibidiProduction marked this conversation as resolved.
Show resolved
Hide resolved
|
||
\alpha \left(e^{x}-1\right) & \text{if } x \leq 0 \\ | ||
x & \text{if } x > 0 | ||
\end{cases} | ||
$$ | ||
|
||
## Parameters | ||
| # | Name | Default | Type | Description | | ||
|---|---|---|---|---| | ||
| 1 | alpha | 1.0 | float | The value at which leakage will begin to saturate. Ex. alpha = 1.0 means that the output will never be less than -1.0 when inactivated. | | ||
|
||
## Size and Performance | ||
ELU is a simple function and is well-suited for deployment on resource-constrained devices or when working with large neural networks. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How did you come up with these size and performance details? I'm noticing that some differ from my understanding. For example, it is not necessarily true when taken in the context of all activation functions that ELU is a simple function or well-suited for resource constrained devices. Perhaps it would actually be more confusing to offer this somewhat subjective explanation. In addition, in practice, activation functions have very little impact on the total runtime of the network - so taking the effort here to detail out their performance is somewhat distracting. How do you feel about dropping this "size and performance" section all together, not being opinionated about individual activation functions, and instead letting the user discover the nuances of each activation function for themselves? However, if there is something truly outstanding about a particular activation functions performance characteristics, then let's make sure to include that in the description of the class. For example, ReLU is outstanding because it is the simplest activation function in the group. Maybe there's another activation function that has an associated kernel that is particularly optimized, etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, we can remove these section at all, it was it was too subjective. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes remove the section, but if there is something unique about a particular functions performance characteristics, we can put that info in the description. What do you think? |
||
## Plots | ||
<img src="../../images/activation-functions/elu.png" alt="ELU Function" width="500" height="auto"> | ||
|
||
<img src="../../images/activation-functions/elu-derivative.png" alt="ELU Derivative" width="500" height="auto"> | ||
|
||
## Example | ||
```php | ||
use Rubix\ML\NeuralNet\ActivationFunctions\ELU; | ||
use Rubix\ML\NeuralNet\ActivationFunctions\ELU\ELU; | ||
|
||
$activationFunction = new ELU(2.5); | ||
``` | ||
|
||
## References | ||
[^1]: D. A. Clevert et al. (2016). Fast and Accurate Deep Network Learning by Exponential Linear Units. | ||
[1]: D. A. Clevert et al. (2016). Fast and Accurate Deep Network Learning by Exponential Linear Units. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<span style="float:right;"><a href="https://github.com/RubixML/ML/blob/master/src/NeuralNet/ActivationFunctions/HardSigmoid/HardSigmoid.php">[source]</a></span> | ||
|
||
# Hard Sigmoid | ||
A piecewise linear approximation of the sigmoid function that is computationally more efficient. The Hard Sigmoid function has an output value between 0 and 1, making it useful for binary classification problems. | ||
|
||
$$ | ||
\text{HardSigmoid}(x) = \max\left(0,\min\left(1, 0.2x + 0.5\right)\right) | ||
$$ | ||
|
||
## Parameters | ||
This activation function does not have any parameters. | ||
|
||
## Size and Performance | ||
Hard Sigmoid has a minimal memory footprint compared to the standard Sigmoid function, as it uses simple arithmetic operations (multiplication, addition) and comparisons instead of expensive exponential calculations. This makes it particularly well-suited for mobile and embedded applications or when computational resources are limited. | ||
|
||
## Plots | ||
<img src="../../images/activation-functions/hard-sigmoid.png" alt="Hard Sigmoid Function" width="500" height="auto"> | ||
|
||
<img src="../../images/activation-functions/hard-sigmoid-derivative.png" alt="Hard Sigmoid Derivative" width="500" height="auto"> | ||
|
||
## Example | ||
```php | ||
use Rubix\ML\NeuralNet\ActivationFunctions\HardSigmoid\HardSigmoid; | ||
|
||
$activationFunction = new HardSigmoid(); | ||
``` | ||
|
||
## References | ||
[1]: https://en.wikipedia.org/wiki/Hard_sigmoid |
Uh oh!
There was an error while loading. Please reload this page.