Activation Functions
Description:
This is the quellcode of an rust crate called: activation_functions
Table of Contents
| Contents |
|---|
| Informations |
| Documentation (GitHub) (docs.rs) |
Some informations:
| Name | Value |
|---|---|
| Language | Rust |
| Programer | SnefDen |
| version | 0.1.0 |
| last update | 10.07.2021 |
Documentation
Table of Contents
| sigmoid | binary step | tanh | rectified linear unit | sigmoid linear unit | gaussian | |
|---|---|---|---|---|---|---|
| f32 | f32::sigmoid | f32::bstep | f32::tanh | f32::relu | f32::silu | f32::gaussian |
| f64 | f64::sigmoid | f64::bstep | f64::tanh | f64::relu | f64::silu | f64::gaussian |
f32
sigmoid(x):
Informations:
Parameter:
// variable stands for parameter
let x:f32; // float32
Used inside:
// variables
let x:f32; // parameter
let result:f32; // return variable
// functions
E.powf;
Return:
// variable stands for return
let result:f32; // float32
Example:
let x:f32 = 0.5;
let answer = sigmoid;
println!;
that would print out the answer and the given x-value in this format
sigmoid(0.5) => 0.62245935
Implementation:
bstep(x):
Informations:
Parameter:
// variable stands for parameter
let x:f32; // float32
Used inside:
// variables
let x:f32; // parameter
let result:f32; // return variable
// functions
E.powf;
Return:
// variable stands for return
let result:f32; // float32
Example:
let x:f32 = 0.5;
let answer = bstep;
println!;
that would print out the answer and the given x-value in this format
bstep(0.5) => 1.0
Implementation:
else
}
tanh(x):
Informations:
Parameter:
// variable stands for parameter
let x:f32; // float32
Used inside:
// variables
let x:f32; // parameter
let result:f32; // return variable
// functions
E.powf;
Return:
// variable stands for return
let result:f32; // float32
Example:
let x:f32 = 0.5;
let answer = tanh;
println!;
that would print out the answer and the given x-value in this format
tanh(0.5) => 0.46211714
Implementation:
relu(x):
Informations:
Parameter:
// variable stands for parameter
let x:f32; // float32
Used inside:
// variables
let x:f32; // parameter
let result:f32; // return variable
// functions
E.powf;
Return:
// variable stands for return
let result:f32; // float32
Example:
let x:f32 = 0.5;
let answer = relu;
println!;
that would print out the answer and the given x-value in this format
relu(0.5) => 1.0
Implementation:
else
}
silu(x):
Informations:
Parameter:
// variable stands for parameter
let x:f32; // float32
Used inside:
// variables
let x:f32; // parameter
let result:f32; // return variable
// functions
E.powf;
Return:
// variable stands for return
let result:f32; // float32
Example:
let x:f32 = 0.5;
let answer = silu;
println!;
that would print out the answer and the given x-value in this format
silu(0.5) => 0.31122968
Implementation:
gaussian(x):
Informations:
Parameter:
// variable stands for parameter
let x:f32; // float32
Used inside:
// variables
let x:f32; // parameter
let result:f32; // return variable
// functions
E.powf;
Return:
// variable stands for return
let result:f32; // float32
Example:
let x:f32 = 0.5;
let answer = gaussian;
println!;
that would print out the answer and the given x-value in this format
gaussian(0.5) => 0.7788008
Implementation:
f64
sigmoid(x):
Informations:
Parameter:
// variable stands for parameter
let x:f64; // float64
Used inside:
// variables
let x:f64; // parameter
let result:f64; // return variable
// functions
E.powf;
Return:
// variable stands for return
let result:f64; // float64
Example:
let x:f64 = 0.5;
let answer = sigmoid;
println!;
that would print out the answer and the given x-value in this format
sigmoid(0.5) => 0.62245935
Implementation:
bstep(x):
Informations:
Parameter:
// variable stands for parameter
let x:f64; // float64
Used inside:
// variables
let x:f64; // parameter
let result:f64; // return variable
// functions
E.powf;
Return:
// variable stands for return
let result:f64; // float64
Example:
let x:f64 = 0.5;
let answer = bstep;
println!;
that would print out the answer and the given x-value in this format
bstep(0.5) => 1.0
Implementation:
else
}
tanh(x):
Informations:
Parameter:
// variable stands for parameter
let x:f64; // float64
Used inside:
// variables
let x:f64; // parameter
let result:f64; // return variable
// functions
E.powf;
Return:
// variable stands for return
let result:f64; // float64
Example:
let x:f64 = 0.5;
let answer = tanh;
println!;
that would print out the answer and the given x-value in this format
tanh(0.5) => 0.46211714
Implementation:
relu(x):
Informations:
Parameter:
// variable stands for parameter
let x:f32; // float32
Used inside:
// variables
let x:f32; // parameter
let result:f32; // return variable
// functions
E.powf;
Return:
// variable stands for return
let result:f32; // float32
Example:
let x:f32 = 0.5;
let answer = relu;
println!;
that would print out the answer and the given x-value in this format
relu(0.5) => 1.0
Implementation:
else
}
silu(x):
Informations:
Parameter:
// variable stands for parameter
let x:f64; // float64
Used inside:
// variables
let x:f64; // parameter
let result:f64; // return variable
// functions
E.powf;
Return:
// variable stands for return
let result:f64; // float64
Example:
let x:f64 = 0.5;
let answer = silu;
println!;
that would print out the answer and the given x-value in this format
silu(0.5) => 0.31122968
Implementation:
gaussian(x):
Informations:
Parameter:
// variable stands for parameter
let x:f64; // float64
Used inside:
// variables
let x:f64; // parameter
let result:f64; // return variable
// functions
E.powf;
Return:
// variable stands for return
let result:f64; // float64
Example:
let x:f64 = 0.5;
let answer = gaussian;
println!;
that would print out the answer and the given x-value in this format
gaussian(0.5) => 0.7788008
Implementation: