neural-net

JAX implementation of a vanilla MLP neural network

https://github.com/timmens/neural-net

Science Score: 18.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.8%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

JAX implementation of a vanilla MLP neural network

Basic Info
  • Host: GitHub
  • Owner: timmens
  • License: mit
  • Language: HTML
  • Default Branch: main
  • Size: 1.32 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Created about 4 years ago · Last pushed over 3 years ago
Metadata Files
Readme License Citation

README.md

Neural Networks

image image pre-commit.ci status image

Topics in Econometrics and Statistics

Summer 2022, Tim Mensinger

This repository contains (source) material for

  1. A custom implementation of a vanilla MLP neural network using JAX. The network is trained on the MNIST data set to recognize hand-written digits.
  2. Two presentations on the theoretical and practical side of neural networks. The theoretical version was presented in class.
  3. A term paper that analyzes neural networks from an econometric perspective.

Paper

The tex-files are stored in the folder [root]/paper and compiled using (a relatively fresh install of) latex. You can view it here

The results in the paper (tables and figures) are generated in a reproducible fashion using pytask. The build process is described below in the section Code.

Presentation

There is a theoretical and a practical presentation. You can view them here

The source code is stored in the folder [root]/presentation and rendered using marp.

Code

Installation

To get started, create and activate the (conda) environment using

bash $ cd 'into project root' $ conda env create -f environment.yml $ conda activate nnet

This installs the package dependencies and the project itself. You can then import functions defined in the repository as

python from nnet.network import build_network from nnet.plotting import plot_examples

Reproduce Paper

To reproduce the results from the paper (tables and figures) you only have to call pytask in an active environment

bash $ cd 'into project root' $ conda activate nnet $ pytask

This creates a folder [root]/bld which contains all tables and figures used in the paper in the subfolder paper.

Custom Neural Network Implementation

For this project I implemented a multilayer-perceptron neural network and its fitting procedure using Jax. The code is found in the module [root]/src/nnet/network.py. It works in both regression and classification settings and is tested on the MNIST dataset that contains hand-written digits.

Warning Jax is not supported on windows.

If you want to run my custom implementation locally I suggest running the notebook [root]/src/nnet/neural_network.ipynb ---or simply view it on nbviewer.


Credits

This project was created with cookiecutter and the cookiecutter-pytask-project template.

Owner

  • Name: Tim Mensinger
  • Login: timmens
  • Kind: user
  • Location: Bonn

economics phd student

Citation (CITATION)

@Unpublished{topics2022,
    Title  = {Project for Topics in Econometrics and Statistics, Summer 2022},
    Author = {Tim Mensinger},
    Year   = {2022},
    Url    = {https://github.com/timmens/topics-project-2022}
}

GitHub Events

Total
Last Year

Dependencies

.github/workflows/main.yml actions
  • actions/checkout v2 composite
  • conda-incubator/setup-miniconda v2 composite
environment.yml conda
  • black
  • catboost
  • conda-lock
  • ipython
  • jupyterlab
  • keras
  • nb_black
  • numpy
  • pandas
  • pip
  • pre-commit
  • pytask >=0.2
  • pytest
  • pytest-cov
  • pytest-xdist
  • python >=3.8
  • scikit-learn
  • seaborn
  • setuptools_scm
  • snakeviz
  • tensorflow
  • toml
  • tox-conda
  • tqdm