Giter Site home page Giter Site logo

kaifishr / neuroevolution Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 1023 KB

A hybrid optimization algorithm that combines gradient descent for network parameter optimization and an evolutionary algorithm for network topology optimization.

License: MIT License

Python 100.00%

neuroevolution's Introduction

NeuroEvolution

A hybrid optimization algorithm combining gradient descent for network parameter optimization coupled with an evolutionary algorithm for network topology and training hyperparameter optimization.

Results

The following graphs show four test runs. All runs used the same set of initial hyperparameters for a fully connected neural network trained on the Fashion-MNIST dataset.

Metrics

Test loss Test accuracy

Hyperparameters

Parameter optimization

Learning rate Batch size Dropout rate Weight decay

Network topology

Neurons hidden layer 1 Neurons hidden layer 2 Neurons hidden layer 3 Neurons hidden layer 4

Networks

Currently, only fully-connected neural networks (Multilayer perceptrons (MLPs)) are supported.

Mutation operators

This implementation comes with different types of mutation operators for hyperparameter and network topology optimization. Although genetic optimization already works reasonably well with these simple rules, many improvements are conceivable.

Proportional mutation

The Proportional Mutation Operator changes the hyperparameter's value proportionally to the value's size. The rate of change is defined by the local_mutation_rate parameter.

eta = rand_sign() * value * local_mutation_rate
value = value + eta

Discrete mutation

The Discrete Mutation Operator changes the hyperparameter's value according to a predefined step size.

eta = rand_sign() * step_size
value = value + eta

Random subset dataloader

To speed up genetic optimization, a custom dataloader allows to train every epoch on a new set of randomly selected data coming from the original dataset using a random mapping from subset indices to original dataset indices:

subset_length = int(len(data) * subset_ratio)
rand_map = random.sample(list(range(len(data))), subset_length)

Random subsets are also used for testing the current population to further accelerate the genetic optimization process. Setting the random subset ratio to small values such as 1 % significantly accelerates optimization.

neuroevolution's People

Contributors

kaifishr avatar

Stargazers

 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.