Fully connected neuron construction, evaluation, and parameters.
More...
Fully connected neuron construction, evaluation, and parameters.
◆ mg_neuron_call()
Evaluate a neuron with the given input values.
- Parameters
-
| g | Graph that owns any intermediate and output values. |
| n | Neuron to evaluate. |
| x | Array of n->n_in input values. |
- Returns
- The output value, or
NULL on invalid input or allocation failure.
◆ mg_neuron_free()
Free memory owned by a neuron.
- Parameters
-
◆ mg_neuron_init()
Initialize a neuron.
- Parameters
-
| g | Graph that owns the neuron's values. |
| n | Neuron to initialize. |
| nin | Number of input values. |
| non_linear | Whether to apply the non-linear activation function. |
- Returns
true on success, false on allocation failure.
◆ mg_neuron_param_count()
| size_t mg_neuron_param_count |
( |
const mg_neuron * |
n | ) |
|
Get the number of trainable parameters in a neuron.
- Parameters
-
- Returns
- Number of weight values plus the bias value.
◆ mg_neuron_params()
Copy a neuron's parameters into a flat array.
- Parameters
-
| n | Neuron to inspect. |
| out | Output array with at least mg_neuron_param_count(n) entries. |