Code Monkey home page Code Monkey logo

neural-network-development's Introduction

Neural-Network-Development

Hello, here I will be displaying the progression of interest in neural networks. The most recent and useful files are in the other project - Reverse Neural Network. The files in this repo are sparsely commented with the important information in the files of the other project

  • StarterNet.java: first MLP built that recognized 81 inputs as a 9 x 9 square of 1's and 0's.
  • ReverseNetDiffAct.java: MLP that still only recognized the numbers in text file but has a different activation function - didn't work
  • ReverseNetTrainNode.java: MLP that can recognize the numbers in text file and has the reverse algorithm implemented. ...more to come
  • implemented inputs of pictures
  • color images
  • video of image being created

Thought Process

I started with developing a single layer MLP that recognized 81 inputs fed in as a 9 x 9 square of 1's and 0's. The network progressed to recognizing images, and trippling the input number to include RGB colors.

I wanted to be able to create images from the neural network and reverse the inputs back. I thought I must be able to retrieve the ideal solutions somehow hidden in the information of the weights. For ease of explanation, let's consider a network with 1 input, 1 hidden node (in 1 layer), and 1 output. As such, after training the weights between all the nodes are known and an output is specified. The nodes from earlier layers and eventually the input can be calculated by using the inverse of the activation function (which I have created in my initial programs). In sentences:

  • output = activation(hidden node * hidden weight)
  • hidden node = inverse(output) / hidden weight

The process can be repeated to find the input. However, this method will only work for this simplest case. As there are more hidden nodes and inputs:

  • output = activation(hNode1 *hWeight1 + hNode2 *hWeight2)

Although, the weights and output are known, the nodes could have various solutions or in fact, infinite (in the case above, as there are two unknown variables but only one equation). I was thinking of some way to collate various equations in the networks like all the equations of hidden nodes to outputs in order to solve the values for hidden nodes and then inputs. To do so, there would need to be an n x n ... x n network and solving for inputs becomes as simple as solving a matrix with n unknowns and n variables (hopefully none are linearly dependent). This is pretty unreasonable in most applicable neural networks, but I wanted to see if it was theoretically possible. I realized that the domain and range of the activation function is annoying when trying to reverse and results in a lot of imaginary calculations, so I tried to change the activation function (but it didn't work :( )

Sigh. At this point, I thought it may not be possible to find an exact solution, and I arrived at the idea that I could train the inputs just as I trained the weights. I looked at the multivariable calculations performed for the training of the weights. The error was minimized with respect to the inputs while the weights were kept constant, and I coded the math into new train functions. At this point, I was not expecting much, but I actually saw meaningful input reversals!!! I tried to make a video of the network drawing an image by training the inputs over epochs, but the network actually trained inputs really fast with a speedy convergence in many different cases.

More information on website, or contact me :).

License BSD

Sriram

neural-network-development's People

Contributors

srirams32 avatar bitdeli-chef 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.