Giter Club home page Giter Club logo

jnn's Introduction

JNN

Java Library for neural networks with evolutionary training

there is a java and c# version

  • java fully tested (needs "Apache common math" for CPU and "JCuda" for Nvidia GPU)
  • C# version in beta because i didn't test it (and is based on a really old Java version of this lib)

Example

The Java version has an Example, where the black rectangle needs to eat the green food and avoid the red enemies

api

Setup

.setup(int[] layout, int AgentCount, int Generationsteps, int MutationRate, boolean cuda);
  • layout describes the NN. for example:

      {2,2,2} means 
      NN has 2 inputs
      2 hidden neurons in one layer
      2 outputs
    
  • Generationsteps is the Amount of times it makes a generation before actually making children, so no AI can get to the next generation by luck

  • If cuda is true the NN will run on your Nvidia GPU. Note: for small NNs CPU is recommended

Training

  • set Input

      	.setInput(int Input, double Value, int Agent);
    
  • run Agent

      	.runAgent(int Agent);
    
  • run Agent with multithreading

      	.runAllAgents();
    
  • get Output (returns double)

      	.getOutput(int Output, int Agent)
    
  • set Fitness

      	.setFitness(float Fitness, int Agent);
    
  • next Generationstep

      	.nextGenerationstep();
    

saveNN

  • save NN

      	.saveNN(int Agent);
    
  • save best NN

      	.saveNN(JNN.getAgentIDPerFitnessList(0));
    

info

  • get Generation (returns int)

      	.getGeneration()
    
  • get Generationstep (returns int)

      	.getGenerationstep()
    
  • get Fitness(returns float)

      	.getAgentFitnessPerFitnessList(int Number)
    
  • get Agent ID orderd with Fitness (returns int)

      	.getAgentIDPerFitnessList(int Number)
    

jnn's People

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.