PRKL-ANN is an educational C++ framework designed for exploring and experimenting with Artificial Neural Networks. It supports Multi-Layer Perceptrons and leverages advanced techniques like Stochastic Gradient Descent and Adaptive Learning Rate to enhance learning efficiency. With built-in CLI tools and pre-trained models, users can seamlessly dive into neural network training and evaluation.
PRKL Artificial Neural Network Framework
The PRKL-ANN is an educational framework designed specifically for those looking to learn and experiment with Artificial Neural Networks (ANNs) using C++. The framework is built with an intuitive API, allowing users to easily navigate through its features.
.prklset) and trained models (.prklmodel), providing flexibility in data handling.It is important to note what PRKL-ANN is not currently optimized for:
Training and evaluating models with PRKL-ANN can be accomplished through simple CLI commands. Here’s how you might train a model using a dataset and evaluate it afterwards:
# Train a model with a dataset
prkl-train -t dataset.prklset -o model.prklmodel -p 50 -c 784,128,64,64,10
# Evaluate the trained model
prkl-evaluate -e evaluation.prklset -m model.prklmodel
To conduct inference on models, create the model in C++ via ann_model, utilize ann_model::forward_propagate(), and retrieve activations from the output layer. A sample program demonstrating this is available in mnist-digits.cpp.
Importing datasets into PRKL-ANN is straightforward despite limited documentation. For instance, a Python script can be utilized to import the original MNIST dataset:
from mlxtend.data import loadlocal_mnist
import numpy as np
import struct
D, L = loadlocal_mnist(
images_path='train-images.idx3-ubyte',
labels_path='train-labels.idx1-ubyte')
with open("mnnist-digits-training.prklset", "wb") as f:
f.write(struct.pack("!QQQ", 28*28, 10, D.shape[0]))
for i in range(D.shape[0]):
for d in D[i]:
f.write(struct.pack("!1f", float(d) / 255.0))
l = np.zeros(10, dtype=np.float32)
l[L[i]] = 1.0
f.write(struct.pack("!10f", *l))
Future enhancements include:
No comments yet.
Sign in to be the first to comment.