|
MLask 1.0.0
A custom c++ deep learning library
|
ActivationFunction class. More...
#include <LambdaActivationFunction.hpp>


Public Member Functions | |
| LambdaActivationFunction (actfunc func, actfunc derv, std::size_t in=0) | |
| vectorOut | forward (vectorIn input) override |
| Performs forward propagation. | |
| vectorIn | backward (vectorOut error) override |
| Performs backward propagation. | |
| void | fit (float_t learning_rate) override |
| No parameters to fit in an activation function, so this method does nothing. | |
Public Member Functions inherited from mlask::Layer | |
| std::size_t | getIn () const |
| std::size_t | getOut () const |
| virtual | ~Layer ()=default |
| virtual bool | tryConvertToONNX (onnx::GraphProto *graph, std::string input, std::string output) const |
| Converts the layer to ONNX format. If the layer cannot be converted, it should return false. | |
| virtual std::string | str () const |
| Returns a string representation of the layer. | |
Additional Inherited Members | |
Protected Attributes inherited from mlask::Layer | |
| std::size_t | in_ |
| std::size_t | out_ |
ActivationFunction class.
Class representing an activation function via two functions passed in constructor
This class is not convertible to ONNX and should preferably be used only for prototyping.
To create your own activation function, you can inherit from Layer abstract class and define the forward and backward methods.
|
inline |
| func | an activation function |
| derv | is a derived form of func |
| in | size of the input, in=0 means the input is not restricted to certain size |
Performs backward propagation.
| error | the error vector |
Implements mlask::Layer.
No parameters to fit in an activation function, so this method does nothing.
Implements mlask::Layer.
Performs forward propagation.
| input | the input vector |
Implements mlask::Layer.