Implementation of neural network with genetic algorithm.
The program takes 8 parametars and they all have to be specified when running the program:
- --train: file to train the NN
- --test: file to test the NN
- --n: layers of neural network split with 's' eg. NN with 2 hidden layer 4 and 5 would be '4s5s'
- --popsize: size of population
- --elitism: how many parents we want to add to next generation
- --p: probability of mutation for elements of a chromosome
- --K: standard deviation in mutation fuction
- --iters: number of iterations to run
foo@bar:~$ python solution.py --train ./files/sine_train.txt --test ./files/sine_test.txt --nn 5s --popsize 10 --elitism 1 --p 0.1 --K 0.1 --iter 10000
It also writes out error of the best individual in a population every 2000 iterations.
The only package that is needed to run the program is numpy
.