Skip to main content

A small framework for teaching students about basics of neural networks

Project description

LENGTH - Lightning-fast Extensible Neural-network Guarding The HPI

logo

A simple neural network implementation that could be used for education. But beware! Some important parts of the code are missing :wink: and you have to fill the blanks!

Installation

  1. Make sure to install Python 3 on your device
  • Windows: Get it here
  • Mac: Get it here or use your favourite package manager
  • Linux: Use your favourite package manager i.e. pacman -S python or apt install python3
  1. Create a virtualenvironment
  • you can do so with python3 -m venv <path to virtualenv>
  • If you are using Linux, we recommend that you install virtualenvwrapper and organize all virtualenvironments with this tool, its quite neat.
  1. Load the virtualenvironment
  2. Clone the repository
  3. Install all necessary libraries with pip install -r requirements.txt

Structure of the Repository

You can find all neural network specific code in the directory length. Follows is a list of all directories and their respective content:

  • data_sets contains code that is necessary for dealing with specific datasets like MNIST or FashionMNIST. Those implementations shall follow the interface specification in length/data_set.py.
  • functions contains code for all neural network functions that do not have any parameters that need to be updated. All those functions follow the interface specified in length/function.py.
  • initializers contains code for weight initializers that follow the initializer interface specified in length/initializer.py.
  • layers contains code for all implemented neural network layers. Those layers follow the interface specification in length/layer.py. A layer is a neural network function that has internal parameters, which need to be updated.
  • models contains code for sample models that come with this library and can be trained out of the box.
  • optimizers contains the implementation of all neural network optimizers. Those implementations follow the interface, specified in length/optimizer.py.
  • tests contains tests for the library, that use py.test as testing framework.

The file train.py in the root directory contains sample code for training a neural network with this library.

Training

You can start a train run, using the sample train script, by entering the following command from the root directory of the repository: python train.py. If you want to know more about possible command-line arguments, type python train.py -h.

Principles of this library

This library follows the design principles of Chainer in a very rudimentary way. This library implements a dynamic computational graph that can be used to easily prototype, design, and debug neural networks. It furthermore allows for the design of dynamic neural networks that change at every iteration, making such an approach suitable for recurrent neural networks.

A word of WARNING: If you ever feel tempted to use this library for training a real neural network and not just a toy example: don't! Use a library like Chainer that is more mature and also supports GPUs. The transition from this library to Chainer should not be that difficult, as the same principles are used here and in Chainer.

Contributions

Contributions in every form are welcome. If you think, that you nicely implemented a new layer, we are happy to see your contribution in form of a pull request!

One Last Thing

Remember: Do not use this library for training a real network. This library is only intended to be used for education and not for real prototyping.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

length_hpi-0.0.3.tar.gz (291.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

length_hpi-0.0.3-py3-none-any.whl (47.4 kB view details)

Uploaded Python 3

File details

Details for the file length_hpi-0.0.3.tar.gz.

File metadata

  • Download URL: length_hpi-0.0.3.tar.gz
  • Upload date:
  • Size: 291.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for length_hpi-0.0.3.tar.gz
Algorithm Hash digest
SHA256 67af719aa33da067e927e3859d5c425fdb7dee4546e3f4c41652e01799a213c6
MD5 258807e6afebb49cd05d8b7dd3a39fa7
BLAKE2b-256 6c58b7571c0b63c3ba34457d74cb5c93d9ae07caaf1e6e6462a7089d86a8e16c

See more details on using hashes here.

File details

Details for the file length_hpi-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: length_hpi-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 47.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for length_hpi-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c9fdeda182f5a2eb287b99d7d57f7a58a51c97440f6bcfb7f63eab5f09aa54d9
MD5 0f448671710415c66a8dc8c9ed43defc
BLAKE2b-256 1be87778be73811eac45dc8125049e0e3f454776a0beeee2066a3d179abe9463

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page