IgANet
IgANets - Isogeometric Analysis Networks
Loading...
Searching...
No Matches
iganet::Tanhshrink Class Reference

Tanhshrink activation function. More...

#include </home/runner/work/iganet/iganet/include/layer.hpp>

Inheritance diagram for iganet::Tanhshrink:
iganet::ActivationFunction iganet::utils::FullQualifiedName

Public Member Functions

torch::Tensor apply (const torch::Tensor &input) const override
 Applies the activation function to the given input.
 
virtual void pretty_print (std::ostream &os=Log(log::info)) const noexcept override
 Returns a string representation of the activation function.
 
torch::serialize::InputArchive & read (torch::serialize::InputArchive &archive, const std::string &key="tanhshrink") override
 Reads the activation function from a torch::serialize::InputArchive object.
 
torch::serialize::OutputArchive & write (torch::serialize::OutputArchive &archive, const std::string &key="tanhshrink") const override
 Writes the activation function into a torch::serialize::OutputArchive object.
 
- Public Member Functions inherited from iganet::ActivationFunction
virtual ~ActivationFunction ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from iganet::utils::FullQualifiedName
virtual const std::string & name () const noexcept
 Returns the full qualified name of the object.
 
- Protected Attributes inherited from iganet::utils::FullQualifiedName
at::optional< std::string > name_
 String storing the full qualified name of the object.
 

Detailed Description

Tanhshrink activation function.

\[ \text{Tanhshrink}(x) = x - \text{Tanh}(x) \]

Member Function Documentation

◆ apply()

torch::Tensor iganet::Tanhshrink::apply ( const torch::Tensor &  input) const
inlineoverridevirtual

Applies the activation function to the given input.

Implements iganet::ActivationFunction.

◆ pretty_print()

virtual void iganet::Tanhshrink::pretty_print ( std::ostream &  os = Log(log::info)) const
inlineoverridevirtualnoexcept

Returns a string representation of the activation function.

Implements iganet::ActivationFunction.

◆ read()

torch::serialize::InputArchive & iganet::Tanhshrink::read ( torch::serialize::InputArchive &  archive,
const std::string &  key = "tanhshrink" 
)
inlineoverridevirtual

Reads the activation function from a torch::serialize::InputArchive object.

Implements iganet::ActivationFunction.

◆ write()

torch::serialize::OutputArchive & iganet::Tanhshrink::write ( torch::serialize::OutputArchive &  archive,
const std::string &  key = "tanhshrink" 
) const
inlineoverridevirtual

Writes the activation function into a torch::serialize::OutputArchive object.

Implements iganet::ActivationFunction.


The documentation for this class was generated from the following file: