Softshrink activation function.
More...
#include </home/runner/work/iganet/iganet/include/layer.hpp>
|
| Softshrink (double lambda) |
|
| Softshrink (torch::nn::functional::SoftshrinkFuncOptions options={}) |
|
| ~Softshrink () override=default |
|
torch::Tensor | apply (const torch::Tensor &input) const override |
| Applies the activation function to the given input.
|
|
torch::nn::functional::SoftshrinkFuncOptions & | options () |
| Returns non-constant reference to options.
|
|
const torch::nn::functional::SoftshrinkFuncOptions & | options () const |
| Returns constant reference to options.
|
|
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="softshrink") override |
| Reads the activation function from a torch::serialize::InputArchive object.
|
|
torch::serialize::OutputArchive & | write (torch::serialize::OutputArchive &archive, const std::string &key="softshrink") const override |
| Writes the activation function into a torch::serialize::OutputArchive object.
|
|
virtual | ~ActivationFunction ()=default |
|
|
torch::nn::functional::SoftshrinkFuncOptions | options_ |
|
|
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.
|
|
Softshrink activation function.
\[
\text{Softshrink}(x) =
\begin{cases}
x - \lambda & \text{ if } x > \lambda
x + \lambda & \text{ if } x < \lambda
0 & \text{ otherwise }
\end{cases}
\]
◆ Softshrink() [1/2]
iganet::Softshrink::Softshrink |
( |
torch::nn::functional::SoftshrinkFuncOptions |
options = {} | ) |
|
|
inlineexplicit |
◆ Softshrink() [2/2]
iganet::Softshrink::Softshrink |
( |
double |
lambda | ) |
|
|
inlineexplicit |
◆ ~Softshrink()
iganet::Softshrink::~Softshrink |
( |
| ) |
|
|
overridedefault |
◆ apply()
torch::Tensor iganet::Softshrink::apply |
( |
const torch::Tensor & |
input | ) |
const |
|
inlineoverridevirtual |
◆ options() [1/2]
torch::nn::functional::SoftshrinkFuncOptions & iganet::Softshrink::options |
( |
| ) |
|
|
inline |
Returns non-constant reference to options.
◆ options() [2/2]
const torch::nn::functional::SoftshrinkFuncOptions & iganet::Softshrink::options |
( |
| ) |
const |
|
inline |
Returns constant reference to options.
◆ pretty_print()
virtual void iganet::Softshrink::pretty_print |
( |
std::ostream & |
os = Log(log::info) | ) |
const |
|
inlineoverridevirtualnoexcept |
◆ read()
torch::serialize::InputArchive & iganet::Softshrink::read |
( |
torch::serialize::InputArchive & |
archive, |
|
|
const std::string & |
key = "softshrink" |
|
) |
| |
|
inlineoverridevirtual |
◆ write()
torch::serialize::OutputArchive & iganet::Softshrink::write |
( |
torch::serialize::OutputArchive & |
archive, |
|
|
const std::string & |
key = "softshrink" |
|
) |
| const |
|
inlineoverridevirtual |
◆ options_
torch::nn::functional::SoftshrinkFuncOptions iganet::Softshrink::options_ |
|
private |
The documentation for this class was generated from the following file: