Giter VIP home page Giter VIP logo

neuralnetwork's Introduction

NeuralNetwork

License Language AppVeyor Travis CI Coveralls
PyPi PyPI Build status Build Status Coverage Status

Installation

Linux:

$ git clone https://github.com/YuriyLisovskiy/NeuralNetwork.git
$ cd NeuralNetwork/
$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Windows:

$ git clone https://github.com/YuriyLisovskiy/NeuralNetwork.git
$ cd NeuralNetwork/
$ virtualenv venv
$ venv/Scripts/activate
$ pip install -r requirements.txt

Run demo:

$ python runner.py test

Usage

  • From neural_network package import network:
     from neural_network.network.net import NeuralNetwork
  • Create training data for training neural network, example:
     training_data = [
         ([0, 0, 0], 0),
         ([0, 0, 1], 1),
         ([0, 1, 0], 0),
         ([0, 1, 1], 0),
         ([1, 0, 0], 1),
         ([1, 0, 1], 1),
         ([1, 1, 0], 0),
         ([1, 1, 1], 1)
     ]
  • Create new neural network using config/config.py or custom parameters, example:
     INPUT_LAYER = [3]
     HIDDEN_LAYERS = [5, 4, 2]
     OUTPUT_LAYER = [1]
     ITERATIONS = 10000
     LEARNING_RATE = 0.007
     new_net = NeuralNetwork(
         input_layer=INPUT_LAYER,
         hidden_layers=HIDDEN_LAYERS,
         output_layer=OUTPUT_LAYER,
         learning_rate=LEARNING_RATE,
         log=False
     )
  • Train the network:
     new_net.train(
         data=training_data,
         iterations=ITERATIONS,
         log=False
     )
  • Now network is ready to work, example:
     def get_prediction(input_data):
         result = new_net.predict(input_data)
         return result >= 0.5
     if __name__ == '__main__':
         print(get_prediction([0, 1, 0]))

Author

License

This project is licensed under the BSD-2-Clause License - see the LICENSE file for details.

neuralnetwork's People

Contributors

yuriylisovskiy 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.