Coder Social home page Coder Social logo

kamodap / python-neural-network Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jorgenkg/python-neural-network

0.0 1.0 0.0 1.02 MB

This is an efficient implementation of a fully connected neural network in NumPy. The network can be trained by a variety of learning algorithms: backpropagation, resilient backpropagation and scaled conjugate gradient learning. The network has been developed with PYPY in mind.

License: BSD 2-Clause "Simplified" License

Python 100.00%

python-neural-network's Introduction

Neural network written in Python (NumPy)

This is an implementation of a fully connected neural network in NumPy. By using the matrix approach to neural networks, this NumPy implementation is able to harvest the power of the BLAS library and efficiently perform the required calculations. The network can be trained by a wide range of learning algorithms.

Visit the project page or Read the documentation.

The code has been tested.

Implemented learning algorithms:

  • Vanilla Backpropagation
  • Backpropagation with classical momentum
  • Backpropagation with Nesterov momentum
  • RMSprop
  • Adagrad
  • Adam
  • Resilient Backpropagation
  • Scaled Conjugate Gradient
  • SciPy’s Optimize

Installation

pip install nimblenet

Requirements

  • Python
  • NumPy
  • Optionally: SciPy

This script has been written with PYPY in mind. Use their jit-compiler to run this code blazingly fast.

Features:

  • Implemented with matrix operations to ensure high performance.
  • Dropout regularization is available to reduce overfitting. Implemented as desribed here.
  • Martin Møller's Scaled Conjugate Gradient for Fast Supervised Learning as published here.
  • PYPY friendly (requires pypy-numpy).
  • Features a selection of cost functions (error functions) and activation functions

Example Usage

    from nimblenet.activation_functions import sigmoid_function
    from nimblenet.cost_functions import cross_entropy_cost
    from nimblenet.learning_algorithms import RMSprop
    from nimblenet.data_structures import Instance
    from nimblenet.neuralnet import NeuralNet


    dataset        = [
        Instance( [0,0], [0] ), Instance( [1,0], [1] ), Instance( [0,1], [1] ), Instance( [1,1], [0] )
    ]

    settings       = {
        "n_inputs" : 2,
        "layers"   : [  (2, sigmoid_function), (1, sigmoid_function) ]
    }

    network        = NeuralNet( settings )
    training_set   = dataset
    test_set       = dataset
    cost_function  = cross_entropy_cost


    RMSprop(
            network,           # the network to train
            training_set,      # specify the training set
            test_set,          # specify the test set
            cost_function,     # specify the cost function to calculate error
        )

python-neural-network's People

Contributors

jorgenkg avatar kamodap avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.