Skip to content

Git-Math/multilayer_perceptron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multilayer Perceptron

This project implements a multilayer perceptron (feedforward artificial neural network) from scratch in order to predict whether a cancer is malignant or benign on a dataset of breast cancer diagnosis in the Wisconsin.
It is divided in two parts:

  • The Training part will train the neural network
  • The Prediction part will make predictions using the trained neural network

Training

The neural network is composed of 4 layers:

  • The input layer containing 30 neurons
  • A first hidden layer containing 21 neurons
  • A second hidden layer containg 21 neurons
  • The output layer containing 2 neurons

The neural network is trained using backpropagation and gradient descent, and can early stop if necessary in order to avoid overfitting.

The program takes a dataset in input, splits it into a training part and a validation part, and then trains the neural network while displaying the loss and validation loss at each step as well as a graph showing their evolution during the learning process at the end.
The model is saved (network topology and weights) at the end of the execution.

How to run

From the root of the repository run python3 mp_train.py resources/data.csv.

Example

multilayer_perceptron_training

Prediction

The program will load the weights learned in the Training part, perform a ion on a given set, then evaluate it using the binary cross-entropy error function as well as some other metrics.

How to run

From the root of the repository run python3 mp_.py resources/data.csv.

Example

multilayer_perceptron_predicting

About

Neural network implemented from scratch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages