Skip to content

Neural network implementation from scratch through a Keras-like API in Python

License

Notifications You must be signed in to change notification settings

gcastro-98/nn-from-scratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nn-from-scratch

Neural network implementation from scratch through a Keras-like API in Python.

It is currently a little sketch, thus it just supports:

  • Few loss functions: log-loss
  • Few activation functions: ReLu & identity
  • Few layer types: just fully-connected layers.
  • The gradient descent is purely stochastic (batch_size = 1) and implemented using Automatic Differentiation
    • Specifically, forward-propagation is used and implemented using the autograd package.

As per example, the code is applied to solve a classification problem, found at the example.py module. Below, an image of the boundary plot of the built classifier is displayed.

boundary_plot

Installation

To install this package's modules into your conda environment conda-env, the .toml file can be leveraged by

(conda-env) $ pip install .

Development (conda) environment

The following needs to be executed in any terminal:

$ conda create -n nn-dev python=3.9 -y
$ conda activate nn-dev
$ conda install numpy sklearn -y
$ conda install -c conda-forge autograd -y
$ conda install -c anaconda sphinx numpydoc \
    sphinx_rtd_theme recommonmark python-graphviz -y
$ pip install --upgrade myst-parser

Documentation

Whenever the modules have been updated, the documentation can be re-generated from the docs folder by typing ():

(nn-dev) nn-from-scratch/docs $ make html

About

Neural network implementation from scratch through a Keras-like API in Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages