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

PCFNN_TRAIN. More...

#include "../../config.h"
#include <stdlib.h>
#include <math.h>
#include "neuron.h"
#include "layer.h"
#include "network.h"
#include "feedforward.h"
#include "backprop.h"
#include "batch.h"
+ Include dependency graph for train.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double * PCFNN_NETWORK_train (struct PCFNN_NETWORK *net, double **data, double **target, size_t size, double validation_split, int shuffle, unsigned long batch_size, size_t epochs, double eta, double alpha, double(*f_cost)(double, double), double(*f_cost_de)(double, double), double *status)
 Train the network net. More...
 

Detailed Description

PCFNN_TRAIN.

Author
Cedric FARINAZZO
Version
0.1
Date
9 may 2019

Train functions for PCFNN neural network

Definition in file train.h.

Function Documentation

◆ PCFNN_NETWORK_train()

PCFNN_NETWORK_train ( struct PCFNN_NETWORK net,
double **  data,
double **  target,
size_t  size,
double  validation_split,
int  shuffle,
unsigned long  batch_size,
size_t  epochs,
double  eta,
double  alpha,
double(*)(double, double)  f_cost,
double(*)(double, double)  f_cost_de,
double *  status 
)

Train the network net.

Parameters
[in]net(struct PCFNN_NETWORK*) a pointer an a PCFNN_NETWORK
[in]data(double**) double array array: an array of input data (lenght of data is size)
[in]target(double**) double array array : an array of expected output of the output layer of net (lenght of target is size)
[in]size(size_t) lenght of data and target
[in]validation_split(double) a double between 0 and 1: the part of the dataset to use to test the network
[in]shuffle(int) 1 to enable shuffle mode and 0 to disable
[in]batch_size(unsigned long) batch size
[in]epochs(size_t) number of epochs to run
[in]eta(double) learning rate
[in]alpha(double) momentum rate
[in]f_cost(double(*f_cost)(double, double)) a cost function pointer
[in]f_cost_de(double(*f_cost_de)(double, double)) a pointer to the f_cost derivative
[out]status(double*) a pointer on a double. Can be NULL. It will contain the percentage of completion of the training. Usefull with thread
Returns
double array of net->outputl->size elements which is the current loss for each output (must be free after usage) if validation_split > 0 else return NULL. NULL if wrong parameters.

Definition at line 26 of file train.c.

+ Here is the call graph for this function: