thesis-nnlib
A machine-learning framework written in C++ and OpenACC-CUDA, inspired by Tensorflow and Keras, for training and evaluation of deep neural networks in NVIDIA GPU-accelerated systems.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.7%) to scientific vocabulary
Repository
A machine-learning framework written in C++ and OpenACC-CUDA, inspired by Tensorflow and Keras, for training and evaluation of deep neural networks in NVIDIA GPU-accelerated systems.
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
- Releases: 0
Metadata Files
README.md
NNLib
A C++ framework, inspired by TensorFlow/Keras, for training and evaluation of deep neural networks in Nvidia GPU-accelerated systems.
Example usage
Provides the Neural namespace plus Neural::Network, Neural::Layers:Fc, Neural::Layers:Conv, Neural::Tensor4D, Neural::Shape4D classes.
```cpp
include "tensor.hpp"
include "network.hpp"
include "layer.hpp"
using Neural::Tensor4D; using Neural::Shape4D; using Neural::Network;
Tensor4D
// We will create a 3-layer network with a Conv->Fc->Output architecture. // Initialize network with input data shape but with batchsize=undefined // traindata.shape() := Shape4D(numsamples, channels, width, height) // testnet.inputshape := Shape4D(-1, channels, width, height) Network testnet(train_data.shape());
// Add Conv Layer with activation
int depthconv1 = 64;
int filtersizeconv1 = 5; // can also be vector
testnet.addlayerNeural::Layers::Conv(depthconv1, "relu", filtersizeconv1, strideconv1, paddingtype_conv1);
// Add hidden FC layer with activation int numhiddennodes = 256; testnet.addlayerNeural::Layers::Fc(numhidden_nodes, "relu");
// Add output layer int numoutputs = 10; testnet.addlayerNeural::Layers::Fc(num_outputs, "softmax");
// Set hyperparameters int batchsize = 32, maxepochs=0, maxstepsperepoch=0; // 0=default, won't stop until algorithm decides double learningrate = 0.1f; bool accelerated_run = true;
// Train network with train and validation datasets testnet.train(traindata, trainlabels, validdata, validlabels, batchsize, acceleratedrun, learningrate, "CrossEntropy", maxepochs, maxstepsper_epoch);
// Evaluate network against test dataset and obtain precision, recall, accuracy and f1score metrics double precisiontest, recalltest, accuracy, f1score; testnet.eval(testdata, testlabels, recalltest, precisiontest, accuracy, f1_score); ```
Installation
Requirements
- Nvidia GPU
- Nvidia-container-toolkit
- Docker
Step 1: Pull the docker image
docker pull sirmihawk/thesis:hpc24.7_build
Step 2: Create a new docker container
The --rm option will create a container which will be auto-removed once the session is ended.
docker run -it --rm --gpus all sirmihawk/thesis:hpc24.7_build
Step 3: Build the library and sample apps
Clone the repository inside the container:
git clone https://github.com/xbouroseu/thesis-nnlib
cd thesis-nnlib
Build the framework and samples with:
make all
Alternatively you can only build the library with:
make lib
and the samples with:
make examples
Step 4: Run the sample MNIST training application
After building the library and the sample apps we can run one example application which is training and evaluating a Convolution Neural Network on the MNIST dataset.
cd samples/mnist_app
The following command is for log-level info and batch_size x. We can also choose to run either the gpu-accelerated version or the non-accelerated one.
For the gpu-accelerated version:
./build/mnist_acc info x
For the non-accelerated version:
./build/mnist_noacc info x
Owner
- Name: Xristos Boulmpasakos
- Login: xbouroseu
- Kind: user
- Repositories: 2
- Profile: https://github.com/xbouroseu
Citation (CITATION.cff)
cff-version: 1.2.0
title: NNLib
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Christos
family-names: Boulmpasakos
repository-code: 'https://www.github.com/xbouroseu/thesis-nnlib'
abstract: >-
A C++ framework, inspired by TensorFlow/Keras, for
training and evaluation of deep neural networks in Nvidia
GPU-accelerated systems.
GitHub Events
Total
- Delete event: 2
- Push event: 3
- Pull request event: 1
- Create event: 1
Last Year
- Delete event: 2
- Push event: 3
- Pull request event: 1
- Create event: 1