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

PCFNN_NETWORK. More...

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

Go to the source code of this file.

Data Structures

struct  PCFNN_NETWORK
 Network unit. More...
 

Typedefs

typedef struct PCFNN_NETWORK PCFNN_NETWORK
 

Functions

struct PCFNN_NETWORKPCFNN_NETWORK_new ()
 Initialize a PCFNN_NETWORK. More...
 
void PCFNN_NETWORK_free (struct PCFNN_NETWORK *net)
 Free all memory allocation of an PCFNN_NETWORK (It will call PCFNN_LAYER_free) More...
 
void PCFNN_NETWORK_clear (struct PCFNN_NETWORK *net)
 Clear all layers in the PCFNN_NETWORK net (It will call PCFNN_LAYER_clear) More...
 
int PCFNN_NETWORK_addl (struct PCFNN_NETWORK *net, struct PCFNN_LAYER *l)
 Add the PCFNN_LAYER l to the PCFNN_NETWORK net. More...
 
int PCFNN_NETWORK_build (struct PCFNN_NETWORK *net)
 Initialize all internal data of the PCFNN_NETWORK l and build of PCFNN_LAYER it contains. More...
 
struct PCFNN_NETWORKPCFNN_NETWORK_build_from_array (size_t *spec, size_t len, double(*f_init)(double), double(*f_act)(double), double(*f_act_de)(double))
 Initialize a new PCFNN_NETWORK from an array of number that represent the number of neurons for each layers. More...
 
size_t PCFNN_NETWORK_get_ram_usage (struct PCFNN_NETWORK *net)
 Give the number of bytes used by the PCFNN_NETWORK net and all PCFNN_LAYER it contains. More...
 
void PCFNN_NETWORK_summary (struct PCFNN_NETWORK *net, size_t param[5])
 Write on param network statistics. More...
 
void PCFNN_NETWORK_print_summary (struct PCFNN_NETWORK *net)
 Print neural network summary. More...
 

Detailed Description

PCFNN_NETWORK.

Author
Cedric FARINAZZO
Version
0.1
Date
5 may 2019

network unit for PCFNN neural network

Definition in file network.h.

Typedef Documentation

◆ PCFNN_NETWORK

typedef struct PCFNN_NETWORK PCFNN_NETWORK

Function Documentation

◆ PCFNN_NETWORK_addl()

PCFNN_NETWORK_addl ( struct PCFNN_NETWORK net,
struct PCFNN_LAYER l 
)

Add the PCFNN_LAYER l to the PCFNN_NETWORK net.

Parameters
[in]net(struct PCFNN_NETWORK*) a pointer an a PCFNN_NETWORK
[in]l(struct PCFNN_LAYER*) a pointer an a PCFNN_LAYER to add
Returns
0 if done, 1 if wrong arguments or -1 if an allocation failed and the network is broken

Definition at line 39 of file network.c.

◆ PCFNN_NETWORK_build()

PCFNN_NETWORK_build ( struct PCFNN_NETWORK net)

Initialize all internal data of the PCFNN_NETWORK l and build of PCFNN_LAYER it contains.

Parameters
[in]net(struct PCFNN_NETWORK*) a pointer an a PCFNN_NETWORK
Returns
0 if done, 1 if wrong arguments or -1 if an allocation failed and the network and all layers it contains are broken

Definition at line 50 of file network.c.

+ Here is the call graph for this function:

◆ PCFNN_NETWORK_build_from_array()

PCFNN_NETWORK * PCFNN_NETWORK_build_from_array ( size_t *  spec,
size_t  len,
double(*)(double)  f_init,
double(*)(double)  f_act,
double(*)(double)  f_act_de 
)

Initialize a new PCFNN_NETWORK from an array of number that represent the number of neurons for each layers.

Parameters
[in]spec(size_t*) array of number that represent the number of neurons for each layers
[in]len(size_t) length of spec
[in]f_init(double(*f_init)()) a pointer on an weights/bias initialisation functon
[in]f_act(double(*f_act)(double)) a pointer on activation functon
[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
Returns
a new PCFNN_NETWORK or NULL if an error occured

Definition at line 70 of file network.c.

+ Here is the call graph for this function:

◆ PCFNN_NETWORK_clear()

PCFNN_NETWORK_clear ( struct PCFNN_NETWORK net)

Clear all layers in the PCFNN_NETWORK net (It will call PCFNN_LAYER_clear)

Parameters
[in]net(struct PCFNN_NETWORK*) a pointer an a PCFNN_NETWORK to clear

Definition at line 31 of file network.c.

+ Here is the call graph for this function:

◆ PCFNN_NETWORK_free()

PCFNN_NETWORK_free ( struct PCFNN_NETWORK net)

Free all memory allocation of an PCFNN_NETWORK (It will call PCFNN_LAYER_free)

Parameters
[in]net(struct PCFNN_NETWORK*) a pointer an a PCFNN_NETWORK to free

Definition at line 21 of file network.c.

+ Here is the call graph for this function:

◆ PCFNN_NETWORK_get_ram_usage()

PCFNN_NETWORK_get_ram_usage ( struct PCFNN_NETWORK net)

Give the number of bytes used by the PCFNN_NETWORK net and all PCFNN_LAYER it contains.

Parameters
[in]net(struct PCFNN_NETWORK*) a pointer an a PCFNN_NETWORK
Returns
(size_t) number of bytes if l is NULL return 0

Definition at line 95 of file network.c.

+ Here is the call graph for this function:

◆ PCFNN_NETWORK_new()

PCFNN_NETWORK_new ( )

Initialize a PCFNN_NETWORK.

Returns
PCFNN_NETWORK structure pointer or NULL if an error occured

Definition at line 9 of file network.c.

◆ PCFNN_NETWORK_print_summary()

PCFNN_NETWORK_print_summary ( struct PCFNN_NETWORK net)

Print neural network summary.

Parameters
[in]net(struct PCFNN_NETWORK*) a pointer an a PCFNN_NETWORK

Definition at line 126 of file network.c.

+ Here is the call graph for this function:

◆ PCFNN_NETWORK_summary()

PCFNN_NETWORK_summary ( struct PCFNN_NETWORK net,
size_t  param[5] 
)

Write on param network statistics.

Parameters
[in]net(struct PCFNN_NETWORK*) a pointer an a PCFNN_NETWORK
[out]param(size_t) network statistics
param[0]: number of unlocked parameters
param[1]: number of locked parameters
param[2]: ram usage in bytes
param[3]: number of layer
param[4]: number of neurons

Definition at line 106 of file network.c.

+ Here is the call graph for this function: