Sigmoid activation function.
More...
#include </home/runner/work/iganet/iganet/include/iganet/net/activation.hpp>
|
| torch::Tensor | apply (const torch::Tensor &input) const override |
| | Applies the activation function to the given input.
|
| |
| 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="sigmoid") override |
| | Reads the activation function from a torch::serialize::InputArchive object.
|
| |
| torch::serialize::OutputArchive & | write (torch::serialize::OutputArchive &archive, const std::string &key="sigmoid") 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.
|
| |
Sigmoid activation function.
\[
\text{Sigmoid}(x) = \sigma(x) = \frac{1}{1+\exp(-x)}
\]
◆ apply()
| torch::Tensor iganet::Sigmoid::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.
◆ pretty_print()
| void iganet::Sigmoid::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::Sigmoid::read |
( |
torch::serialize::InputArchive & |
archive, |
|
|
const std::string & |
key = "sigmoid" |
|
) |
| |
|
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.
◆ write()
| torch::serialize::OutputArchive & iganet::Sigmoid::write |
( |
torch::serialize::OutputArchive & |
archive, |
|
|
const std::string & |
key = "sigmoid" |
|
) |
| 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.
The documentation for this class was generated from the following file: