Batch Normalization as described in the paper.
More...
#include </home/runner/work/iganet/iganet/include/iganet/net/activation.hpp>
|
| | BatchNorm (torch::Tensor running_mean, torch::Tensor running_var, const torch::Tensor &weight, const torch::Tensor &bias, double eps, double momentum, bool training=false) |
| | Provides the BatchNorm operation.
|
| |
| | BatchNorm (torch::Tensor running_mean, torch::Tensor running_var, torch::nn::functional::BatchNormFuncOptions options={}) |
| | Provides the BatchNorm operation.
|
| |
| | ~BatchNorm () override=default |
| |
| torch::Tensor | apply (const torch::Tensor &input) const override |
| | Applies the activation function to the given input.
|
| |
| torch::nn::functional::BatchNormFuncOptions & | options () |
| | Returns non-constant reference to options.
|
| |
| const torch::nn::functional::BatchNormFuncOptions & | options () const |
| | Returns constant reference to options.
|
| |
| void | pretty_print (std::ostream &os) const noexcept override |
| | Returns a string representation of the activation function.
|
| |
| torch::serialize::InputArchive & | read (torch::serialize::InputArchive &archive, const std::string &key="batch_norm") override |
| | Reads the activation function from a torch::serialize::InputArchive object.
|
| |
| torch::Tensor & | running_mean () |
| | Returns non-constant reference to running mean.
|
| |
| const torch::Tensor & | running_mean () const |
| | Returns constant reference to running mean.
|
| |
| torch::Tensor & | running_var () |
| | Returns non-constant reference to running var.
|
| |
| const torch::Tensor & | running_var () const |
| | Returns constant reference to running variance.
|
| |
| torch::serialize::OutputArchive & | write (torch::serialize::OutputArchive &archive, const std::string &key="batch_norm") const override |
| | Writes the activation function into a torch::serialize::OutputArchive object.
|
| |
| | ~ActivationFunction () override=default |
| |
|
| virtual | ~FullQualifiedName ()=default |
| |
| virtual const std::string & | name () const noexcept |
| | Returns the full qualified name of the object.
|
| |
| at::optional< std::string > | name_ |
| | String storing the full qualified name of the object.
|
| |
Batch Normalization as described in the paper.
Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift, https://arxiv.org/abs/1502.03167.
◆ BatchNorm() [1/2]
| iganet::BatchNorm::BatchNorm |
( |
torch::Tensor |
running_mean, |
|
|
torch::Tensor |
running_var, |
|
|
torch::nn::functional::BatchNormFuncOptions |
options = {} |
|
) |
| |
|
inlineexplicit |
Provides the BatchNorm operation.
- Parameters
-
| running_mean | Value of running_mean. |
| running_var | Value of running_var. |
| options | Configuration options. |
◆ BatchNorm() [2/2]
| iganet::BatchNorm::BatchNorm |
( |
torch::Tensor |
running_mean, |
|
|
torch::Tensor |
running_var, |
|
|
const torch::Tensor & |
weight, |
|
|
const torch::Tensor & |
bias, |
|
|
double |
eps, |
|
|
double |
momentum, |
|
|
bool |
training = false |
|
) |
| |
|
inlineexplicit |
Provides the BatchNorm operation.
- Parameters
-
| running_mean | Value of running_mean. |
| running_var | Value of running_var. |
| weight | Value of weight. |
| bias | Value of bias. |
| eps | Value of eps. |
| momentum | Value of momentum. |
| training | Value of training. |
◆ ~BatchNorm()
| iganet::BatchNorm::~BatchNorm |
( |
| ) |
|
|
overridedefault |
◆ apply()
| torch::Tensor iganet::BatchNorm::apply |
( |
const torch::Tensor & |
input | ) |
const |
|
inlineoverridevirtual |
Applies the activation function to the given input.
- Parameters
-
| input | Tensor to which the activation function is applied. |
- Returns
- The activated tensor.
Implements iganet::ActivationFunction.
◆ options() [1/2]
| torch::nn::functional::BatchNormFuncOptions & iganet::BatchNorm::options |
( |
| ) |
|
|
inline |
Returns non-constant reference to options.
- Returns
- Mutable reference to the activation options.
◆ options() [2/2]
| const torch::nn::functional::BatchNormFuncOptions & iganet::BatchNorm::options |
( |
| ) |
const |
|
inline |
Returns constant reference to options.
- Returns
- Constant reference to the activation options.
◆ pretty_print()
| void iganet::BatchNorm::pretty_print |
( |
std::ostream & |
os | ) |
const |
|
inlineoverridevirtualnoexcept |
Returns a string representation of the activation function.
- Parameters
-
| os | Stream that receives the representation. |
Implements iganet::ActivationFunction.
◆ read()
| torch::serialize::InputArchive & iganet::BatchNorm::read |
( |
torch::serialize::InputArchive & |
archive, |
|
|
const std::string & |
key = "batch_norm" |
|
) |
| |
|
inlineoverridevirtual |
Reads the activation function from a torch::serialize::InputArchive object.
- Parameters
-
| archive | Input archive from which the activation state is read. |
| key | Key prefix under which the state is stored. |
- Returns
- A reference to
archive.
Implements iganet::ActivationFunction.
◆ running_mean() [1/2]
| torch::Tensor & iganet::BatchNorm::running_mean |
( |
| ) |
|
|
inline |
Returns non-constant reference to running mean.
- Returns
- Result of the operation.
◆ running_mean() [2/2]
| const torch::Tensor & iganet::BatchNorm::running_mean |
( |
| ) |
const |
|
inline |
Returns constant reference to running mean.
- Returns
- Result of the operation.
◆ running_var() [1/2]
| torch::Tensor & iganet::BatchNorm::running_var |
( |
| ) |
|
|
inline |
Returns non-constant reference to running var.
- Returns
- Result of the operation.
◆ running_var() [2/2]
| const torch::Tensor & iganet::BatchNorm::running_var |
( |
| ) |
const |
|
inline |
Returns constant reference to running variance.
- Returns
- Result of the operation.
◆ write()
| torch::serialize::OutputArchive & iganet::BatchNorm::write |
( |
torch::serialize::OutputArchive & |
archive, |
|
|
const std::string & |
key = "batch_norm" |
|
) |
| const |
|
inlineoverridevirtual |
Writes the activation function into a torch::serialize::OutputArchive object.
- Parameters
-
| archive | Output archive that receives the activation state. |
| key | Key prefix under which the state is stored. |
- Returns
- A reference to
archive.
Implements iganet::ActivationFunction.
◆ options_
| torch::nn::functional::BatchNormFuncOptions iganet::BatchNorm::options_ |
|
private |
◆ running_mean_
| torch::Tensor iganet::BatchNorm::running_mean_ |
|
private |
◆ running_var_
| torch::Tensor iganet::BatchNorm::running_var_ |
|
private |
The documentation for this class was generated from the following file: