Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

patztablook22/nanuk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nanuk

Neural Netwurk

Shallow neural network lib written in C++, from scratch.

Demo

using namespace nanuk;

Nanuk n({4, 3, 2, 1}); // 4 input neurons, 2 hidden layers, 1 output neuron
n.learing_params(
    10000,  // epochs
    .4      // learning rate [epsilon]
);

// train model
std::ifstream data("data.csv");
n.learn(data, [](unsigned epoch, Scalar cost) {
    std::cout << "Epoch " << epoch << ": " << cost << std::endl;
});

// apply model
Tensor1D output = n({ /* input vector */ });
std::cout << output[0] << std::endl;

Dependencies

  • C++14
  • CMake

Setup

Run ./setup.sh to generate libnanuk.so shared object and example executable.

Releases

No releases published

Packages

No packages published