Giter VIP home page Giter VIP logo

Comments (4)

wagenaartje avatar wagenaartje commented on May 22, 2024 1

@momire the MNIST dataset is quite a big (and a little more complex) dataset. Calling the evolve() function won't necessarily converge, and it's very time-expensive due to the networks being very big (~800 nodes). For me, one generation with 60 genomes takes about 20 seconds. (PS: i'm working on speeding up evolution drastically using webworkers).

However, it is definitely possible to evolve a network to work on the MNIST dataset, it just requires the use of various options. I'll be posting an example soon, but in the mean time, use the option { log: 1} and you will see the network improving.

@alancnet I think I might create an extra option that disables warnings in functions that weren't called by the user. So warnings stay enabled when the user calles mutate() but not when it happens from the evolve() function.

from neataptic.

momire avatar momire commented on May 22, 2024 1

I tried your advice and it worked!
Thanks for your help.
(Unfortunately, I don't know how to use Web Walker for my skill)

from neataptic.

alancnet avatar alancnet commented on May 22, 2024

I agree warnings should be disabled by default, but there is a simple way to disable them:

require('neataptic').Config.warnings = false

from neataptic.

wagenaartje avatar wagenaartje commented on May 22, 2024

So a small example of training options which seems to work quite well for me (but still takes super long):

var mnist = require('mnist');
var neataptic = require('neataptic');

var set = mnist.set(700,20);
var trainingSet = set.training;
var testset = set.test;

var network= new neataptic.Network(784,10);

for(var i = 0; i < network.connections.length; i++){
  network.connections[i].weight = Math.random() * .02 - .01;
}

var results = network.evolve(trainingSet, {
  iterations: 150, // just so it stopped after a while
  elitism: 5, // 10%
  mutationRate: 0.7, // fairly high, yes
  equal: true,
  growth: 0, // this can create very large networks, you can also remove this 
  log: 1 // see how well it's doing
});

As you might have noticed, I have a custom weight initialisation algorithm. Neataptic doesn't take into account that 784 connections cause any (sigmoid) connected neuron to activate 1 with default weight init. I already have a clean weight initialisation process in my head which i'm coding now.

If you need more help with evolving the MNIST set let me know.

PS: I think the MNIST dataset works better with a backprop + evolve technique, which I might incorperate in the future.

from neataptic.

Related Issues (20)

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.