#include <layer.h>
Public Member Functions | |
Layer (size_t n_in, size_t n_out, std::string activate_function="tanh") | |
Layer (const Layer &other) | |
Layer & | operator= (const Layer &other) |
Layer & | operator= (Layer &&other) noexcept |
Layer (Layer &&other) noexcept | |
const std::vector< Variable > & | parameters () const |
const std::vector< Neuron > & | neurons () const |
std::vector< Variable > | forward (const std::vector< double > &inputs) |
std::vector< Variable > | forward (const std::vector< Variable > &variables) |
This class represents a layer in a neural network, consisting of multiple neurons.
|
inline |
Constructs a layer with the specified number of input and output connections, and activation function.
n_in | The number of input connections. |
n_out | The number of output connections. |
activate_function | The activation function of the layer. Default is "tanh". |
|
inline |
Copy constructor.
other | The layer to be copied. |
|
inlinenoexcept |
Move assignment operator.
other | The layer to be assigned. |
std::vector< Variable > Layer::forward | ( | const std::vector< double > & | inputs | ) |
Computes the forward pass of the layer given a vector of input values.
inputs | The input values. |
Computes the forward pass of the layer given a vector of input variables.
variables | The input variables. |
|
inline |
Returns the neurons in the layer.
Copy assignment operator.
other | The layer to be assigned. |
Move constructor.
other | The layer to be moved. |
|
inline |
Returns all parameters of the layer, including parameters of all neurons.