MLask 1.0.0
A custom c++ deep learning library
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
mlask::Layer Class Referenceabstract

Base class for all layers in the neural network. More...

#include <Layer.hpp>

Inheritance diagram for mlask::Layer:
Inheritance graph
[legend]

Public Member Functions

std::size_t getIn () const
 
std::size_t getOut () const
 
virtual ~Layer ()=default
 
virtual vectorOut forward (vectorIn)=0
 Defines a way to move forward in a neural network.
 
virtual vectorIn backward (vectorOut)=0
 Defines a way to backpropagate error in backropagation algorithm.
 
virtual void fit (float_t learning_rate)=0
 Describes how the layer 'learns', meaning it defines how layer updates itself.
 
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.
 

Protected Attributes

std::size_t in_
 
std::size_t out_
 

Detailed Description

Base class for all layers in the neural network.

Constructor & Destructor Documentation

◆ ~Layer()

virtual mlask::Layer::~Layer ( )
virtualdefault

Member Function Documentation

◆ backward()

virtual vectorIn mlask::Layer::backward ( vectorOut  )
pure virtual

Defines a way to backpropagate error in backropagation algorithm.

Implemented in mlask::LambdaActivationFunction, mlask::FullyConnectedLayer< in, out >, mlask::SoftMax, and mlask::ActivationFunction.

◆ fit()

virtual void mlask::Layer::fit ( float_t  learning_rate)
pure virtual

Describes how the layer 'learns', meaning it defines how layer updates itself.

Implemented in mlask::SoftMax, mlask::ActivationFunction, mlask::LambdaActivationFunction, and mlask::FullyConnectedLayer< in, out >.

◆ forward()

virtual vectorOut mlask::Layer::forward ( vectorIn  )
pure virtual

Defines a way to move forward in a neural network.

Implemented in mlask::LambdaActivationFunction, mlask::FullyConnectedLayer< in, out >, mlask::SoftMax, and mlask::ActivationFunction.

◆ getIn()

std::size_t mlask::Layer::getIn ( ) const
inline

◆ getOut()

std::size_t mlask::Layer::getOut ( ) const
inline

◆ str()

virtual std::string mlask::Layer::str ( ) const
inlinevirtual

◆ tryConvertToONNX()

virtual bool mlask::Layer::tryConvertToONNX ( onnx::GraphProto *  graph,
std::string  input,
std::string  output 
) const
inlinevirtual

Converts the layer to ONNX format. If the layer cannot be converted, it should return false.

Reimplemented in mlask::LeakyRelu, mlask::Relu, mlask::Sigmoid, mlask::SoftMax, mlask::Tanh, and mlask::FullyConnectedLayer< in, out >.

Member Data Documentation

◆ in_

std::size_t mlask::Layer::in_
protected

◆ out_

std::size_t mlask::Layer::out_
protected

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