ANN  0.1.1.5
A library containing multiple neural network models written in C
neuron.c File Reference
#include <stdlib.h>
#include "ANN/models/PCFNN/neuron.h"
+ Include dependency graph for neuron.c:

Go to the source code of this file.

Functions

struct PCFNN_NEURONPCFNN_NEURON_new (size_t size, double(*f_init)(), double(*f_act)(double), double(*f_act_de)(double))
 Initialize a PCFNN_NEURON. More...
 
void PCFNN_NEURON_clear (struct PCFNN_NEURON *n)
 Clear a PCFNN_NEURON. More...
 
void PCFNN_NEURON_free (struct PCFNN_NEURON *n)
 Free all memory allocation of an PCFNN_NEURON. More...
 
void PCFNN_NEURON_addinputs (struct PCFNN_NEURON *n, size_t inputs)
 Increase the input size of the PCFNN_NEURON. More...
 
void PCFNN_NEURON_build (struct PCFNN_NEURON *n)
 Initialize all internal data of a PCFNN_NEURON. More...
 
size_t PCFNN_NEURON_get_ram_usage (struct PCFNN_NEURON *n)
 Give the number of bytes used by the PCFNN_NEURON n. More...
 
struct PCFNN_NEURONPCFNN_NEURON_clone (struct PCFNN_NEURON *n)
 Copy the input size, initialisation function and activation function from n and create a new PCFNN_NEURON. More...
 
struct PCFNN_NEURONPCFNN_NEURON_clone_all (struct PCFNN_NEURON *n)
 Copy all data from n and create a new PCFNN_NEURON. More...
 
void PCFNN_NEURON_set_state_lock (struct PCFNN_NEURON *n, enum PCFNN_NEURON_LOCK_STATE state)
 Set lock state of the neuron n. More...
 
void PCFNN_NEURON_summary (struct PCFNN_NEURON *n, size_t param[2])
 Write on param the number of unlocked parameters and locked parameters. More...
 

Function Documentation

◆ PCFNN_NEURON_addinputs()

void PCFNN_NEURON_addinputs ( struct PCFNN_NEURON n,
size_t  inputs 
)

Increase the input size of the PCFNN_NEURON.

Parameters
[in]n(struct PCFNN_NEURON*) a pointer an a PCFNN_NEURON
[in]inputs(size_t) number of input to add. if 0 do nothing.

Definition at line 41 of file neuron.c.

◆ PCFNN_NEURON_build()

void PCFNN_NEURON_build ( struct PCFNN_NEURON n)

Initialize all internal data of a PCFNN_NEURON.

Parameters
[in]n(struct PCFNN_NEURON*) a pointer an a PCFNN_NEURON

Definition at line 48 of file neuron.c.

◆ PCFNN_NEURON_clear()

void PCFNN_NEURON_clear ( struct PCFNN_NEURON n)

Clear a PCFNN_NEURON.

Parameters
[in]n(struct PCFNN_NEURON*) a pointer an a PCFNN_NEURON

Definition at line 21 of file neuron.c.

◆ PCFNN_NEURON_clone()

struct PCFNN_NEURON* PCFNN_NEURON_clone ( struct PCFNN_NEURON n)

Copy the input size, initialisation function and activation function from n and create a new PCFNN_NEURON.

Parameters
[in]n(struct PCFNN_NEURON*) a pointer an a PCFNN_NEURON
Returns
(struct PCFNN_NEURON*) the new neuron or NULL if an error occured

Definition at line 70 of file neuron.c.

+ Here is the call graph for this function:

◆ PCFNN_NEURON_clone_all()

struct PCFNN_NEURON* PCFNN_NEURON_clone_all ( struct PCFNN_NEURON n)

Copy all data from n and create a new PCFNN_NEURON.

Parameters
[in]n(struct PCFNN_NEURON*) a pointer an a PCFNN_NEURON
Returns
(struct PCFNN_NEURON*) the new neuron or NULL if an error occured

Definition at line 77 of file neuron.c.

+ Here is the call graph for this function:

◆ PCFNN_NEURON_free()

void PCFNN_NEURON_free ( struct PCFNN_NEURON n)

Free all memory allocation of an PCFNN_NEURON.

Parameters
[in]n(struct PCFNN_NEURON*) a pointer an a PCFNN_NEURON to free

Definition at line 28 of file neuron.c.

◆ PCFNN_NEURON_get_ram_usage()

size_t PCFNN_NEURON_get_ram_usage ( struct PCFNN_NEURON n)

Give the number of bytes used by the PCFNN_NEURON n.

Parameters
[in]n(struct PCFNN_NEURON*) a pointer an a PCFNN_NEURON
Returns
(size_t) number of bytes

Definition at line 60 of file neuron.c.

◆ PCFNN_NEURON_new()

struct PCFNN_NEURON* PCFNN_NEURON_new ( size_t  size,
double(*)()  f_init,
double(*)(double)  f_act,
double(*)(double)  f_act_de 
)

Initialize a PCFNN_NEURON.

Parameters
[in]size(size_t) input size
[in]f_init(double(*f_init)()) a pointer on an weights/bias initialisation functon or NULL
[in]f_act(double(*f_act)(double)) a pointer on activation functon or NULL
[in]f_act_de(double(*f_act_de)(double)) a pointer on derivative activation functon who is the derivate of the f_act function pointer or NULL
Returns
PCFNN_NEURON structure pointer or NULL if an error occured

Definition at line 6 of file neuron.c.

◆ PCFNN_NEURON_set_state_lock()

void PCFNN_NEURON_set_state_lock ( struct PCFNN_NEURON n,
enum PCFNN_NEURON_LOCK_STATE  state 
)

Set lock state of the neuron n.

Parameters
[in]n(struct PCFNN_NEURON*) a pointer an a PCFNN_NEURON
[in]state(enum PCFNN_NEURON_LOCK_STATE) lock state

Definition at line 97 of file neuron.c.

◆ PCFNN_NEURON_summary()

void PCFNN_NEURON_summary ( struct PCFNN_NEURON n,
size_t  param[2] 
)

Write on param the number of unlocked parameters and locked parameters.

Parameters
[in]n(struct PCFNN_NEURON*) a pointer an a PCFNN_NEURON
[out]param(size_t) param[0] will be the number of unlocked parameters and param[1] the number of locked parameters

Definition at line 103 of file neuron.c.