Skip to content

gudeh/IWLS2020Final

Repository files navigation

IWLS 2020 Contest, team CGP Brazil!

This code stores a Cartesian Genetic Programming (CGP) implementation designed to solve the IWLS 2020 contest with a Machine Learning technique. This implementation is based on an evolutive design, inspiered by the evolution of living beings. The CGP is composed of a set of individuals, also known as population, and their genetic code is stored in a matrix format, which is a cartesian description of connections the individuals have with each other. Each individual in this particular implementation represents a circuit to be discovered. Where the contest exposes a partial (tiny most of the times) behaviour of each circuit in PLA files. In this implementation, the CGP nodes are equivalent (most of the time) to AND nodes from the AND-Inverter Graph (AIG) format. The learning with the CGP technique comes from mutations applied during the learning process, individuals have a certain predetermined (and adaptive) chance to mutate at each generation. The individuals are then evlauated after mutations to choose a father to generate the next offspring generation of individuals.

The CGP may initialize its processing with previously created AIGs from other techniques implemented by the team. Such as Decision Trees generated with the Scikit-learn (SK) tool and the Espresso technique from pyEDA, the SK requires its files to be present during the CGP execution (already provided here at "CGPcode/CPP/" folder) and Espresso runs properly when installed at the system, also both requires an ABC tool executable. The original PLAs provided by the contest are required and there is also the option of using modified PLAs generated by the team ("Benchmarks_3 and Benchmarks_4, both with a 80-20 distribution of the provided dataset). All of theese required files are provided in the git project, although one should attend to proper building of binary files for ABC if it fails to run. The ones provided here were built in a linux distribution.

The code compilation requires a GCC compiler which supports C++11. If one wishes he may reexecute the other tools used integrated with CGP (AIG files for both options are already available at folders "AIGS_BEST" for SK and "Benchmarks_3_espresso_aig" for espresso AIGs). A python installation is required for SK to run properly to create the AIGs and modified PLAs, for Espresso the pyEDA library is required to be installed, it may be done with "pip3 install pyeda" (for further instructions vide: https://pypi.org/project/pyeda/). To compile and run the CGP code it is required only to run the "run_cgp.sh" script file. There a lot of different compilation options found at the AIG.h header file, those options are all commented with descriptions. The uploaded version on github is configured to run the SK and Espresso tools to generate the required files. Afterwards the CGP will run once every exemplar with 1000 generations and choosing the best initialization possible among the three possible ones (SK,Espresso and Random) for each exemplar. The "AIGs" folder stores the generated AIGs as the CGP program output.

The precompiler option "#define generate_starting_aigs 1" calls for the execution of the other tools used by the team (SK and Espresso). Their interaction with the CGP is tested and should be operational, but if you have library dependencies or architecture-compatibility problems, just clone the git repository as it is, since it already has the modified PLAs and generated AIGs by SK and Espresso, and turn off the "generate_starting_aigs" with a 0, this should execute only the CGP program with already set input data.

It was a great journey and we were able to achieve good results. A lot was done and a lot was learned. The due date asks for a persistent and quick pace to develop the project, something that maybe would not be achieved otherwise. I'd like to thank everyone participating in the team: Cristina Meinhardt, Jonata Tyska, Brunno Abreu, Mateus Grellert and Isac Campos, it was great to work with you guys and I'll maybe miss our weekly online meetings during COVID times. I would like also to thank the organizing commite of the IWLS contest to provide this great opportunity for us to learn and produce an interesting and useful little system based on Machine Learning. I am relly thankful, this was a great experience and certanly there is still a lot to be explored further! Cheers.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published