|
| | ~ActivationFunction () override=default |
| |
| virtual torch::Tensor | apply (const torch::Tensor &input) const =0 |
| | Applies the activation function to the given input.
|
| |
| void | pretty_print (std::ostream &os) const noexcept override=0 |
| | Returns a string representation of the activation function.
|
| |
| virtual torch::serialize::InputArchive & | read (torch::serialize::InputArchive &archive, const std::string &key)=0 |
| | Reads the activation function from a torch::serialize::InputArchive object.
|
| |
| virtual torch::serialize::OutputArchive & | write (torch::serialize::OutputArchive &archive, const std::string &key) const =0 |
| | Writes the activation function into a torch::serialize::OutputArchive object.
|
| |
Abstract activation function structure.
| virtual torch::serialize::InputArchive & iganet::ActivationFunction::read |
( |
torch::serialize::InputArchive & |
archive, |
|
|
const std::string & |
key |
|
) |
| |
|
pure virtual |
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.
Implemented in iganet::BatchNorm, iganet::CELU, iganet::ELU, iganet::GELU, iganet::GLU, iganet::GroupNorm, iganet::GumbelSoftmax, iganet::Hardshrink, iganet::Hardsigmoid, iganet::Hardswish, iganet::Hardtanh, iganet::InstanceNorm, iganet::LayerNorm, iganet::LeakyReLU, iganet::LocalResponseNorm, iganet::LogSigmoid, iganet::LogSoftmax, iganet::Mish, iganet::None, iganet::Normalize, iganet::PReLU, iganet::ReLU, iganet::ReLU6, iganet::RReLU, iganet::SELU, iganet::Sigmoid, iganet::SiLU, iganet::Softmax, iganet::Softmin, iganet::Softplus, iganet::Softshrink, iganet::Softsign, iganet::Tanh, iganet::Tanhshrink, and iganet::Threshold.
| virtual torch::serialize::OutputArchive & iganet::ActivationFunction::write |
( |
torch::serialize::OutputArchive & |
archive, |
|
|
const std::string & |
key |
|
) |
| const |
|
pure virtual |
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.
Implemented in iganet::BatchNorm, iganet::CELU, iganet::ELU, iganet::GELU, iganet::GLU, iganet::GroupNorm, iganet::GumbelSoftmax, iganet::Hardshrink, iganet::Hardsigmoid, iganet::Hardswish, iganet::Hardtanh, iganet::InstanceNorm, iganet::LayerNorm, iganet::LeakyReLU, iganet::LocalResponseNorm, iganet::LogSigmoid, iganet::LogSoftmax, iganet::Mish, iganet::None, iganet::Normalize, iganet::PReLU, iganet::ReLU, iganet::ReLU6, iganet::RReLU, iganet::SELU, iganet::Sigmoid, iganet::SiLU, iganet::Softmax, iganet::Softmin, iganet::Softplus, iganet::Softshrink, iganet::Softsign, iganet::Tanh, iganet::Tanhshrink, and iganet::Threshold.