Neural Network library
Copyright (c) 2019 Cole Design and Development, LLC
This is a lightweight neural network library for use in microcontrollers and embedded systems.
The code is divided into three sections:
nn.[ch]- The neural net library, which can be pulled into a project in whole, and should not require modification to use.
train.c- An example of how to use nn.c to construct, train, and save a neural network model.
test.c- Evaluates the model performance, comparing that of seen vs. unseen data.
predict.c- Demonstrates how to use a saved neural network model in the target application to make predictions on new data.
With this library, neural networks of any width and depth may be constructed and trained. The following activation functions are supported:
- Leaky ReLU
Different activation functions may be assigned to each layer in the network.
A bias can be added to each layer independently.
To build the nn library and sample training and prediction programs, just type:
The included example data is the Semeion Handwritten Digit Data Set from the UCI Machine Learning Repository at:
To evaluate the model performance:
To use the trained model:
The network architecture is a fully connected feed-forward neural network. The widths of each layer, the activation function to be used, and the bias for each layer is set as each successive layer is added to the network using the
nn_add_layer() function call. Multiple layers may be added to construct a deep neural network.
Copyright (c) Cole Design and Development, LLC. All rights reserved.
Licensed under the Apache License 2.0.