Giter Site home page Giter Site logo

minhaskamal / intellectron Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 6.0 233 KB

An Infant Library of Artificial Neural Network (multilayer-deep-convolutional-machine-learning)

Home Page: http://minhaskamal.github.io/Intellectron

License: MIT License

Java 100.00%
artificial-neural-networks deep-learning neural-network machine-learning library machine-learning-library deep-learning-library java

intellectron's Introduction

Intellectron

An Infant Library of Artificial Neural Network

The project is a simple implementation of Deep Neural Network. Several machine learning algorithms are put together here. This tiny library is particularly suitable for small projects.

How to Use?

  1. Download Intellectron.jar, and integrate it in your project's build path.
  2. Now, use it in your project like this-
	// This is a demonstration of XOR gate implementation in Neural Network.
	public static void main(String[] args) {
		// For XOR gate-
		// ------------------
		// | input | output |
		// |----------------|
		// | 0 | 0 |   0    |
		// | 0 | 1 |   1    |
		// | 1 | 0 |   1    |
		// | 1 | 1 |   0    |
		// ------------------
		double[][] inputs = new double[][]{
			{0, 0}, {0, 1}, {1, 0}, {1, 1}
		};
		double[][] expectedOutputs = new double[][]{
			{0}, {1}, {1}, {0}
		};
		
		// Here, we are creating four layers of neural network.
		// First layer is created automatically using the input data.
		// Here the input has two categories, so first layer (input layer)
		// will have 2 neurons. 
		// The second layer will contain- 4, third layer- 2, and fourth layer
		// (output layer) contains 1 neuron.
		int[] numbersOfNeuronsInLayers = new int[]{4, 2, 1};
		
		// The 'DeepNeuralNetworkImplementation' object takes the network 
		// structure, learning rate, and number of inputs (input categories).
		DeepNeuralNetworkImplementation deepNeuralNetworkImplementation = 
			new DeepNeuralNetworkImplementation(numbersOfNeuronsInLayers, 0.1, 2);
		
		// Here we are running 20,000 cycles to train the network.
		// In each cycle we are passing the input and expected output.
		System.out.println("# Training...\n");
		int cycle = 20000;
		for(int i=0; i<cycle; i++){
			deepNeuralNetworkImplementation.train(inputs, expectedOutputs);
		}
		
		// Storing knowledge in the memory storage
		System.out.println("# Storing Knowledge...\n");
		String workspace = System.getenv("SystemDrive") + System.getenv("HOMEPATH") + "\\Desktop\\";
		deepNeuralNetworkImplementation.dump(workspace+"knowledge.xml");
		
		// Predicting output for inputs from acquired knowledge
		System.out.println("# Predicting...");
		double prediction;
		prediction = deepNeuralNetworkImplementation.predict(new double[]{0, 0})[0];
		System.out.println("input- 0, 0; prediction- "+prediction);
		prediction = deepNeuralNetworkImplementation.predict(new double[]{0, 1})[0];
		System.out.println("input- 0, 1; prediction- "+prediction);
		prediction = deepNeuralNetworkImplementation.predict(new double[]{1, 0})[0];
		System.out.println("input- 1, 0; prediction- "+prediction);
		prediction = deepNeuralNetworkImplementation.predict(new double[]{1, 1})[0];
		System.out.println("input- 1, 1; prediction- "+prediction);
	}

You can find some simple implementations in the test section. There is also a beautiful project created with Intellectron- DeepGenderRecognizer; you will get a nice insight from it too.

Releases

License

MIT License

Intellectron is licensed under MIT License.

intellectron's People

Contributors

minhaskamal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

intellectron's Issues

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.