ANN  0.1.1.5
A library containing multiple neural network models written in C
neuron.h File Reference

PCFNN_NEURON. More...

#include "../../config.h"
#include <stdlib.h>
+ Include dependency graph for neuron.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PCFNN_NEURON
 Neuron unit. More...
 

Typedefs

typedef struct PCFNN_NEURON PCFNN_NEURON
 

Enumerations

enum  PCFNN_NEURON_LOCK_STATE { PCFNN_NEURON_LOCK, PCFNN_NEURON_UNLOCK }
 Lock state of a neuron. More...
 

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...
 

Detailed Description

PCFNN_NEURON.

Author
Cedric FARINAZZO
Version
0.1
Date
5 may 2019

Neuron unit for PCFNN neural network

Definition in file neuron.h.

Typedef Documentation

◆ PCFNN_NEURON

typedef struct PCFNN_NEURON PCFNN_NEURON

Enumeration Type Documentation

◆ PCFNN_NEURON_LOCK_STATE

Lock state of a neuron.

Enumerator
PCFNN_NEURON_LOCK 
PCFNN_NEURON_UNLOCK 

Definition at line 22 of file neuron.h.

Function Documentation

◆ PCFNN_NEURON_addinputs()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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.