GithubHelp home page GithubHelp logo

klotzjesse / neuralnetwork Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 90.67 MB

A simple, unfinished java implementation of a rudimentary artificial intelligence framework, trained using the MNIST data set for the classification of numbers.

License: GNU General Public License v3.0

Java 100.00%
ai neuralnetwork neural-network neural-networks machine-learning mnist-classification seminararbeit neurons

neuralnetwork's Introduction

neuralnetwork logo

neuralnetwork

A simple, unfinished java implementation of a rudimentary artificial intelligence framework written in java, trained using the MNIST data set for the classification of numbers.

What is Artifical Intelligence

For the present purpose the artificial intelligence problem is taken to be that of making a machine behave in ways that would be called intelligent if a human were so behaving.

-- John McCarthy, 1955, known as the father of AI
    firstly coined the term "artificial intelligence" (aka A PROPOSAL FOR THE DARTMOUTH SUMMER RESEARCH PROJECT ON ARTIFICIAL INTELLIGENCE)

CircleCI Docker Image Size (latest by date) Libraries.io dependency status for GitHub repo GitHub code size in bytes GitHub repo size GitHub

Run MNIST-Training example network

Prerequisities

In order to run this container you'll need docker installed.

Install

Pull jesseklotz2306/neuralnetwork from the Docker repository:

docker pull jesseklotz2306/neuralnetwork

Run

Run the image:

docker run jesseklotz2306/neuralnetwork

Usage

Setup

Two hidden layer configuration (add as many as you want). Using the Swish activation function and an exponential rectifier as activation function. Outputs a probability distribution in relation to the plausibility of the input value.

Input Neurons: 720, Hidden Layer 1: 28, Hidden Layer 2: 14, Output Neurons: 10

Every neuron is by default densely connected to each other (synapses) and initialized using the Xavier Initializer.

NeuronalNetwork neuralNetwork = new NeuronalNetworkBuilder()
                .layer(720, ActivationFunction.IDENTITY)
                .layer(28, ActivationFunction.SWISH_RECTIFIER)
                .layer(14, ActivationFunction.EXPONENTIAL_RECTIFIER)
                .layer(10, ActivationFunction.SOFTMAX)
                .initializer(Initializer.XAVIER_INITIALIZER)
                .build();

The network is capable of carrying out the learning process using various learning techniques. At the moment just Backpropagation is implemented.

Strategy backPropagation = new StrategyBuilder(new BackPropagation())
                            .learningRate(0.2f)
                            .momentum(0.9f)
                            .regularization(new Dropout())
                            .neuronalNetwork(network)
                            .build();

Training

/*Set Input Data*/
network.input(/* Input Data [784-Dimensions] */);

int outputLayerSize = network.layers.getLast().size();

/*Initialize output matrix for expected size*/
float[] out = new float[outputLayerSize];
for (int i = 0; i < outputLayerSize; i++) {
    out[i] = 0;
}

/*Set winning Output Neuron, e.g. number 3*/
out[3] = 1.0f;

/*Set expected Output Matrix*/
network.setAnticipatedOutput(out);

/*Let network train*/
backPropagation.learn();

License

GitHub

neuralnetwork's People

Contributors

klotzjesse avatar

Watchers

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