alib
Universal C Library Collection for Machine Learning & Artificial Intelligence
Loading...
Searching...
No Matches
nn.h
Go to the documentation of this file.
1
10#ifndef NN_H
11#define NN_H
12
13#include "la.h"
14#include "calc.h"
15#include <assert.h>
16#include <math.h>
17
37
58nn_neural_network nn_alloc(size_t* arch, size_t layer_count,
59 calc_function activation, double learning_rate);
60
77void nn_fprint(nn_neural_network nn, FILE* fp);
78
88#define nn_output(nn) (nn).as[(nn).layer_count]
89
104
126
198
213
236#endif
A simple calculus library header.
A simple linear algebra library header.
void nn_update_weights(nn_neural_network nn)
Update the weights and biases of the neural network.
void nn_backpropagation(nn_neural_network nn, la_matrix y)
Perform backpropagation to compute gradients.
void nn_fit(nn_neural_network nn, la_matrix X, la_matrix y, la_matrix y_pred)
Train the neural network using the given dataset.
void nn_fprint(nn_neural_network nn, FILE *fp)
Print the details of the neural network to a file.
struct nn_neural_network nn_neural_network
Structure representing a neural network.
nn_neural_network nn_alloc(size_t *arch, size_t layer_count, calc_function activation, double learning_rate)
Allocate and initialize a neural network.
double nn_calculate_cost(la_matrix y, la_matrix y_pred, la_matrix cost)
Calculate the cost of the neural network's predictions.
void nn_forward(nn_neural_network nn, la_matrix input)
Perform a forward pass through the neural network.
Structure representing an function and its derivative.
Definition calc.h:30
Structure representing a matrix.
Definition la.h:22
Structure representing a neural network.
Definition nn.h:24
la_matrix * dbs
Definition nn.h:34
la_matrix * as
Definition nn.h:32
size_t layer_count
Definition nn.h:25
la_matrix * ws
Definition nn.h:30
la_matrix * bs
Definition nn.h:31
calc_function activation
Definition nn.h:27
la_matrix * dws
Definition nn.h:33
la_matrix * das
Definition nn.h:35
double learning_rate
Definition nn.h:29