/library-simpleNeuralNetwork

This is a simple fully connected neural network library for deep learning. Include example.

Primary LanguagePython

Readme

Table of Contents

Description

/!\ This repo needs to be refactored

This library allows to create and fit a custom neural network. This library was made during data predictive module course at EPF engineering school. It is a very simple library, you can only create fully connected of neural network. However, it is possible to adjust layer count and size to your needs.

Prerequisites

  • python 3.8

Documentation

Installation

Install dependencies:

pip install -r requirements.txt

Create a neural network

dnn = DeepNeuralNetwork(n_neurons=[784, 128, 64, 10])

You can define the layer count and size in n_neurons. n_neurons list correspond to the network layer list. Each element of the list correspond to the side of the layer. Please note that the first element represent the input layer and the last to the ouput layer. You network needs to have at least 2 layers.

Fit the model

dnn.fit(X_train, Y_train, X_val, Y_val, epochs=5, batch_size=16, l_rate=1e-2)

The above expression fit the model called ‘dnn’

Evaluate the model

dnn.predict(X_test)

The above expression evaluate the model called ‘dnn’ with the ‘X_test’ data.

Run example script

python3 ./example/handWrittenNumbersExample.py

Run test

pytest ./tests/*