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