Coder Social home page Coder Social logo

daherk2 / neuralpy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jon--lee/neuralpy

0.0 1.0 0.0 4.1 MB

neuralpy - neural network library written in python

Home Page: https://jon--lee.github.io/neuralpy

Python 9.34% HTML 5.14% CSS 46.06% JavaScript 39.46%

neuralpy's Introduction

neuralpy 1.3.0

Within this package is the most intuitive fully-connected multilayer neural network model. Data science shouldn't have a high barrier to entry. neuralpy handles the math and overhead while you focus on the data.

neuralpy is a neural network model written in python based on Michael Nielsen's neural networks and deep learning book.

Getting Started (quick start)

The following demonstrates how to download and install neuralpy and how to create and train a simple neural network. Run the following command to download and install:

$ pip install neuralpy

Create a neural network in your project by specifying the number of nodes in each layer. Random weights and biases will automatically be generated:

import neuralpy
net = neuralpy.Network([2, 3, 1])

The network feeds input vectors as python lists forward and returns the output vector as a list:

x = [1, 1]
output = net.forward(x)
print output
# ex: [0.11471727263613461]

Train the neural network by first generating training data in the form of a list of tuples. Each tuple has two components and each component is a list representing the input and output respectively. This training set represents the simple OR function and it can be generated for you to save typing:

training_data = neuralpy.load_or()
# [
#   ([1, 1], [1]),
#   ([1, 0], [1]),
#   ...
# ]

Then we must specify the remaining hyperparameters. Let's say we want to limit it to 100 epochs and give it a learning rate of 1:

epochs = 100
learning_rate = 1

Then run the train method with the parameters. We're telling the network to conform to training data:

net.train(training_data, epochs, learning_rate)

Now feed forward the input from earlier and the output should be closer to 1.0, which is what we trained the network to do:

output = net.forward(x)
print output            # ex: [0.9542129706170075]

There is more information about advanced options such as monitoring the cost in the official documentation.

Since, this is a multilayer feedforward neural network, it is a universal approximator (Hornik, Stinchcombe and White, 1989). Neural Networks can be used for a wide range of applications from image processing to time series prediction.

  • "You abandoned me. You left me to die."
  • "Well, I wouldn't have done it if I'd known you were going to hassle me about it."

neuralpy's People

Contributors

jon--lee avatar

Watchers

James Cloos 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.