Giter VIP home page Giter VIP logo

carimo198 / neural-networks-twin-spirals Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.75 MB

This is the repository for the neural networks I developed using PyTorch to train two models on the famous Two Spirals Problem (Lang & Witbrock 1988). The code from spiral_main.py loads the training data from spirals.csv, and applies the specified model and produces a graph of the resulting function, along with the data.

Python 100.00%

neural-networks-twin-spirals's Introduction

neural-networks-twin-spirals

This is the repository for the neural networks I developed to train two models on the famous Two Spirals Problem (Lang & Witbrock 1988). The code from spiral_main.py loads the training data from spirals.csv, and applies the specified model and produces a graph of the resulting function, along with the data. The code for the models (using PyTorch) are in spiral.py which include:

  • PolarNet - the cartesian (x,y) input in spirals.csv is converted to polar coordinates (r,a) with r=sqrt(xx + yy), a=atan2(y,x). Next, (r,a) is fed into a fully connected neural network with one hidden layer using tanh activation, followed by a single output using sigmoid activation. Use the following code in the command line to run the model: python3 spiral_main.py --net polar --hid 10
  • RawNet - which operates on the raw input (x,y) without converting to polar coordinates and consisting of two fully connected hidden layers with tanh activation, plus the output layer, with sigmoid activation. Different hyperparameter values were experimented with. Use the following code to run the model: python3 spiral_main.py --net raw. You can use --hid, --init, --epoch, to experiment with different hyperparameter values.

Refer to spirals_report.pdf for a discussion on the two implemented models.

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.