Python Forum
Python programming and a dataset
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python programming and a dataset
#3
I was just programming a simple (for me) program in python. It was suppoed to run, but it failed. I am not sure why.
Python seems a very easy language,but the concept of a dataset it was slowing me down.

I will attach the readme file and you can see in what context it is being used. I cannot attach the file so I will have to just copy and past it.

# Evolve a neural network with a genetic algorithm

This is an example of how we can use a genetic algorithm in an attempt to find the optimal network parameters for classification tasks.

It's currently limited to only MLPs (ie. fully connected networks) and uses the Keras library to build, train and validate.

On the easy MNIST dataset, we are able to quickly find a network that reaches > 98% accuracy. On the more challenging CIFAR10 dataset, we get to 56% after 10 generations (with population 20).

For more, see this blog post: 
https://medium.com/@harvitronix/lets-evolve-a-neural-network-with-a-genetic-algorithm-code-included-8809bece164

For a more robust implementation that you can use in your projects, take a look at [Jan Liphardt's implementation, DeepEvolve](https://github.com/jliphard/DeepEvolve).

## To run

To run the brute force algorithm:

```python3 brute.py```

To run the genetic algorithm:

```python3 main.py```

You can set your network parameter choices by editing each of those files first. You can also choose whether to use the MNIST or CIFAR10 datasets. Simply set `dataset` to either `mnist` or `cifar10`.

## Credits

The genetic algorithm code is based on the code from this excellent blog post: https://lethain.com/genetic-algorithms-cool-name-damn-simple/

## Contributing

Have an optimization, idea, suggestion, bug report? Pull requests greatly appreciated!

## License

MIT
Reply


Messages In This Thread
Python programming and a dataset - by ErnestTBass - Feb-04-2019, 03:51 PM
RE: Python programming and a dataset - by buran - Feb-04-2019, 04:24 PM
RE: Python programming and a dataset - by ErnestTBass - Feb-04-2019, 05:37 PM
RE: Python programming and a dataset - by buran - Feb-04-2019, 07:18 PM
RE: Python programming and a dataset - by buran - Feb-05-2019, 02:03 PM
RE: Python programming and a dataset - by buran - Feb-05-2019, 06:02 PM
RE: Python programming and a dataset - by buran - Feb-05-2019, 06:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using Autoencoder for Data Augmentation of numerical Dataset in Python Marvin93 2 3,429 Jul-10-2020, 07:18 PM
Last Post: Marvin93

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020