NeuroTIC 0.0
Loading...
Searching...
No Matches
nttrain.h File Reference

Training Utilities.
https://tituxdev.github.io/NeuroTIC/src/CPU/nttrain.c. More...

#include "ntcore.h"
Include dependency graph for nttrain.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  traindata_t
 Structure to hold training dataset and parameters. More...
 

Typedefs

typedef data_t precision_t
 
typedef uint64_t sample_t
 
typedef uint64_t attempts_t
 
typedef struct traindata_t traindata_t
 Structure to hold training dataset and parameters.
 

Functions

void newtraindata (traindata_t *train_data, net_s *net)
 Allocates memory for training data arrays.
 
attempts_t backpropagation (net_s *net, traindata_t *data)
 Trains a network using backpropagation.
 

Detailed Description

Training Utilities.
https://tituxdev.github.io/NeuroTIC/src/CPU/nttrain.c.

Provides functions to allocate training datasets and train feedforward networks using standard backpropagation.

Author
Oscar Sotomayor
Date
2026

Definition in file nttrain.h.

Typedef Documentation

◆ attempts_t

typedef uint64_t attempts_t

◆ precision_t

typedef data_t precision_t

◆ sample_t

typedef uint64_t sample_t

◆ traindata_t

typedef struct traindata_t traindata_t

Structure to hold training dataset and parameters.

Function Documentation

◆ backpropagation()

attempts_t backpropagation ( net_s net,
traindata_t train_data 
)

Trains a network using backpropagation.

Parameters
netPointer to the network to train.
train_dataPointer to the training data.
Returns
attempts_t Number of iterations performed.

Implements the backpropagation algorithm to train the network. For each training sample:

  • Computes outputs via feedforward.
  • Calculates errors for each neuron.
  • Propagates deltas backward and updates weights and biases.
  • Repeats until error is below tolerance or max_attempts is reached.

References feedforward(), net_s::layers, traindata_t::max_attempts, net_s::neurons, traindata_t::samples, and traindata_t::tolerance.

◆ newtraindata()

void newtraindata ( traindata_t train_data,
net_s net 
)

Allocates memory for training data arrays.

Parameters
traindata_tPointer to training data structure to initialize.
net_sPointer to the network being trained.

Allocates memory for training data arrays.
Initializes in and results arrays based on the network structure and number of samples.

References net_s::layers, and traindata_t::samples.