Hardsigmoid activation function.
More...
#include </home/runner/work/iganet/iganet/include/layer.hpp>
|
| Hardsigmoid ()=default |
|
| ~Hardsigmoid () override=default |
|
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="hardsigmoid") override |
| Reads the activation function from a torch::serialize::InputArchive object.
|
|
torch::serialize::OutputArchive & | write (torch::serialize::OutputArchive &archive, const std::string &key="hardsigmoid") const override |
| Writes the activation function into a torch::serialize::OutputArchive object.
|
|
virtual | ~ActivationFunction ()=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.
|
|
Hardsigmoid activation function.
\[
\text{Hardsigmoid}(x) =
\begin{cases}
0 & \text{ if } x \le -3
1 & \text{ if } x \ge +3
x/6 + 1/2 & \text{ otherwise }
\end{cases}
\]
◆ Hardsigmoid()
iganet::Hardsigmoid::Hardsigmoid |
( |
| ) |
|
|
explicitdefault |
◆ ~Hardsigmoid()
iganet::Hardsigmoid::~Hardsigmoid |
( |
| ) |
|
|
overridedefault |
◆ apply()
torch::Tensor iganet::Hardsigmoid::apply |
( |
const torch::Tensor & |
input | ) |
const |
|
inlineoverridevirtual |
◆ pretty_print()
virtual void iganet::Hardsigmoid::pretty_print |
( |
std::ostream & |
os = Log(log::info) | ) |
const |
|
inlineoverridevirtualnoexcept |
◆ read()
torch::serialize::InputArchive & iganet::Hardsigmoid::read |
( |
torch::serialize::InputArchive & |
archive, |
|
|
const std::string & |
key = "hardsigmoid" |
|
) |
| |
|
inlineoverridevirtual |
◆ write()
torch::serialize::OutputArchive & iganet::Hardsigmoid::write |
( |
torch::serialize::OutputArchive & |
archive, |
|
|
const std::string & |
key = "hardsigmoid" |
|
) |
| const |
|
inlineoverridevirtual |
The documentation for this class was generated from the following file: