Giter VIP home page Giter VIP logo

mistertea / hyperneat Goto Github PK

View Code? Open in Web Editor NEW
91.0 10.0 32.0 85.86 MB

The original implementation of HyperNEAT in C++

Home Page: http://eplex.cs.ucf.edu/hyperNEATpage/HyperNEAT.html

License: Other

HTML 45.41% C++ 51.30% Makefile 0.36% TeX 0.37% PostScript 0.03% Python 0.61% C 1.27% Shell 0.12% CSS 0.08% Perl 0.01% Max 0.01% XSLT 0.24% Assembly 0.10% Tcl 0.01% JavaScript 0.04% C# 0.03% Cuda 0.01% Gnuplot 0.01% Fortran 0.01% Objective-C 0.01%

hyperneat's Introduction

HyperNEAT v4.0 C++,
By Jason Gauci
http://ucfpawn.homelinux.com/joomla/
[email protected]

Documentation for this package is included in this README file.  

-------------
1. LICENSE
-------------

Copyright (c) 2008, Jason Gauci
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, 
are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this 
list of conditions and the following disclaimer. 

Redistributions in binary form must reproduce the above copyright notice, this 
list of conditions and the following disclaimer in the documentation and/or 
other materials provided with the distribution. 

Neither HyperNEAT nor the names of its contributors may be used 
to endorse or promote products derived from this software without specific prior 
written permission. 

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
THE POSSIBILITY OF SUCH DAMAGE.

---------------------
2. USAGE and SUPPORT
---------------------

We hope that this software will be a useful starting point for your own
explorations in interactive evolution with NEAT. The software is provided 
as is; however, we will do our best to maintain it and accommodate
suggestions. If you want to be notified of future releases of the
software or have questions, comments, bug reports or suggestions, send
an email to [email protected]

Alternatively, you may post your questions on the NEAT Users Group at :
http://tech.groups.yahoo.com/group/neat/.

The following explains how to use HyperNEAT.  For information on compiling
HyperNEAT, please see the section on compiling below.

INTRO
-----
HyperNEAT is an extension of NEAT (NeuroEvolution of Augmenting Topologies)
that evolves CPPNs (Compositional Pattern Producing Networks) that
encode large-scale neural network connectivity patterns.  A complete
explanation of HyperNEAT is available here:

@InProceedings{gauci:aaai08,
  author       = "Jason Gauci and Kenneth O. Stanley",
  title        = "A Case Study on the Critical Role of Geometric Regularity in Machine Learning",
  booktitle    = "Proceedings of the Twenty-Third AAAI Conference on Artificial Intelligence (AAAI-2008).",
  year         = 2008,
  publisher    = "AAAI Press",
  address      = "Menlo Park, CA",
  site         = "Chicago",
  url          = "http://eplex.cs.ucf.edu/publications.html#gauci.aaai08",
}

@InProceedings{gauci:gecco07,
  author       = "Jason Gauci and Kenneth O. Stanley",
  title        = "Generating Large-Scale Neural Networks Through Discovering Geo
metric Regularities",
  booktitle    = "Proceedings of the Genetic and Evolutionary
                  Computation Conference (GECCO 2007)",
  year         = 2007,
  publisher    = "ACM Press",
  address      = "New York, NY",
  site         = "London",
  url          = "http://eplex.cs.ucf.edu/index.php?option=com_content&task=view&id=14&Itemid=28#gauci.gecco07",
}

The version of HyperNEAT distributed in this package executed the experiments
in the above papers.

For more information, please visit the EPlex website at:
http://eplex.cs.ucf.edu/

or see more of our publications on HyperNEAT and CPPNs at:
http://eplex.cs.ucf.edu/publications.html


COMMAND LINE
------------
To use the command line interface, simply pass the data file and the output
file as parameters to the HyperNEAT executable, and it will process the
data file and put the resulting population as an XML file in the output file
location.

GUI
---
To load an experiment, go to file->load_experiment and then select the .dat
file that corresponds to the experiment you would like to load.

When the experiment is loaded, go to file->run_experiment to begin the
experiment.  In the console, you can see the results for each generation.

If you wish to pause the experiment, go to file->pause_experiment.  This
command will finish the current generation and then halt the experiment.  You
can continue by going to file->continue_experiment.

At the moment, the restart_experiment function has not been implemented
and you can't load another experiment without first closing the program
(although you may "continue experiment" after you have paused).

It is possible to view an individual interactively by choosing the
individual you want from the spinners and then clicking "view".
This brings up a separate window where you can interact with the
individual (if the experiment supports it) and you can also see
the CPPN that created the individual.

Some experiments contain a post-hoc analysis that does a more complete
test of an individual.  This analysis can be achieved by clicking the "Analyze"
button and the results are typically displayed in the console.

--------------
3. EXPERIMENTS
--------------

FIND CLUSTER EXPERIMENT
-----------------------
This is the experiment presented in the GECCO 2007 paper (see above).  The
goal of the experiment is for the network to generate the highest amount of
activation at the center of the larger square, regardless of the positions.

While in the view panel, a number of functions are possible:

To position a square, click on the substrate (the grid).  It will place one 
square and then the other.

To view the connectivity, right-click.  As you move the mouse across the
grid, each square in the grid now represents the connection going from
the grid square under your mouse to that location.  A cross-hatch pattern
represents a negative weight.  You can return to the input layer by 
right-clicking again.

To view the substrate output, middle-click.  The resulting grid represents
the output plane of the state space sandwich.  The darker colors represent
a higher activation level, and a cross-hatch pattern represents a negative
level of activation. you can return to the input layer by middle-clicking.

To save a series of images of your state at several resolutions, click on
"Save Images" at the top.  *NOTE* This takes a very long time!

To increase/decrease the resolution of the substrate, click the 
appropriate wording on the screen. *NOTE* This also takes a very long time!

FIND CLUSTER NO GEOM EXPERIMENT
-------------------------------
This is the "Find Cluster Experiment" but using P-NEAT (perceptron NEAT).
This takes a very long time because it's trying to use NEAT on a
14641-link network.

FIND POINT EXPERIMENT
---------------------
This was the precursor to the FindClusterExperiment.  It looks for a point
on the input substrate and tries to put a similar point on the output
substrate.  I'm not sure if it still works.

TIC TAC TOE EXPERIMENT
----------------------
This was designed as a proof of concept that we could solve Tic Tac Toe.  It tries to set an output value high when there is a tic tac toe (i.e., someone has won).

TIC TAC TOE GAME EXPERIMENT
----------------------
This is a Tic Tac Toe implementation in HyperNEAT.  It can consistently produce a perfect tic tac toe player.  During training, an individual is exposed to every possible tic tac toe game.  Even so, it runs fairly quickly.

CHECKERS EXPERIMENT
-------------------
This is the HyperNEAT implementation of Checkers, as discussed in the AAAI 08 
paper (see above).  The goal of the experiment is to defeat the Simplech 
heuristic in checkers at a ply depth of 4.

If you view an individual, you can play a game of checkers against any
individual at any generation you specify. When you see "Black's turn. Click 
to see black's move", simply click on the board and it will show you 
the move that the computer made. When you see "Move from?", click on the 
white piece that you would like to move, and when you see "Move to?", click 
on the destination.  If you would like to jump a piece or several pieces, 
click on the destination after all the jumps.  If the move was valid, 
you will see the board change and then you can click to see HyperNEAT's 
response.  If the move wasn't valid, you will be asked "Move from?" and 
you must pick a valid move.

*NOTE*:
There is nothing in the fitness function to prevent HyperNEAT from deciding 
that a board evaluation of 0.9999 is completely winning for white and  
0.99999999 is completely winning for black.  As a result, all of the board 
evaluation functions will be in the range [0.9999, 0.99999999].  As a 
result of this, the evaluation process could become dependent on the 
specific architecture of your computer and floating point implementation 
of your compiler.  I have found that changing this line:

typedef float CheckersNEATDatatype;

to:

typedef double CheckersNEATDatatype;

allows you to evaluate a run from one architecture on another architecture 
without losing performance. I have only tested this on a few runs.  
Ideally, if you want to see the real performance of an individual, the 
best thing is to evolve your own player on your machine.

CHECKERS ORIGINAL FOGEL EXPERIMENT
----------------------------------
This is called NEAT-EI in the paper.  It is an implementation of the NEAT 
Checkers player as inspired by Charapella & Fogel (see AAAI 08 paper above). 
This player does not use HyperNEAT, but uses a direct encoding with 
engineered inputs.

*NOTE*: Please see *NOTE* above, as it applies to this method as well.


--------------
4. RESULTS
--------------
A number of completed runs have been placed in the "out/Results/" folder.  
To load one of these runs, select "file->load_population" from the menu bar.

--------------
5. COMPILING
--------------

DEPENDENCIES
--------------
HyperNEAT depends on the TinyXMLDLL Library version 2.0,
JG Template Library (http://sourceforge.net/projects/jgtl/),
Boost c++ libraries (http://www.boost.org/) and
WxWidgets *Only if building in GUI mode* (http://www.wxwidgets.org/).

For information on how
to build & install those libraries, please see their respective websites.

HyperNEAT uses cmake as it's build system, and requires cmake 2.6 or later.

BUILD INSTRUCTIONS:
---------------
UNIX/LINUX/CYGWIN/MACOSX:

Create a HyperNEAT/build directory.

Inside the HyperNEAT/build directory, create two subdirectories, one for debug and one for release:

mkdir build/debug
mkdir build/release

Now, run ccmake on each of those directories and put the appropriate configuration (debug for *_debug, release for *_release):

ccmake ../../

The USE_GUI setting can be set to turn on/off the GUI.  If the GUI is 
disabled, the code does not depend on WxWidgets.

Now, just run "make" on the build/*/ directories and the dlls & libraries should be created in the out/ folder


WINDOWS:

Create a HyperNEAT/build directory.

Inside the build directory, create a subdirectory:

build/msvc8 (or whatever version you have)

Now, run cmake on that subdirectory.

The USE_GUI setting can be set to turn on/off the GUI.  If the GUI is 
disabled, the code does not depend on WxWidgets.

Then, open the project and build a debug and release version.

If the compiler is unable to find certain header files, that probably means
that you need to correctly set the CMake build variables that have to
do with the location of include files for the dependencies.

If the linker is unable to find certain library files, that means
that you either need to fix the CMake build variables for libraries,
or that the names of the libraries have changed for some reason.


--------------
6. FORUM
--------------

We are available to answer questions at the NEAT Users Group:

http://tech.groups.yahoo.com/group/neat/


hyperneat's People

Contributors

mistertea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hyperneat's Issues

error in activation function ONES_COMPLIMENT?

I was reading your code to see what activation functions were used and noticed that the computation of activation function ONES_COMPLIMENT (e.g. in files NEAT_FractalNetwork.cpp
and NEAT_FastNetwork.cpp, and may be others) contains the following lines where the second overrides the result of the first, which looks like an error. Should there be another variable instead of retVal on the first line?

(line 839) retVal = max(0.0,tmpVal2);  
(line 840) retVal = 1.0-tmpVal2;

buildAll.sh not working

Tried building with the shell script on 2 different machines, console window closes right after "building engine with toolset".
I have added the missing Boost files as said in the repo.

some errors when build this project

1
I am trying to build HyperNEAT on ubuntu 14.04, but when I download the project zipfile and extract it, i do not encounter a build directory in the /HyperNEAT , /tinyxmldll and /JGTL. When i build them as the HyperNEAT C++ Version 3.0 Manual, some errors appeared as the picture shows.

wx/wxprec.h' file not found

After building with cbuild, when i try to do make on the build folder i get the following error:

NE/HyperNEAT/Hypercube_NEAT/include/HCUBE_Defines.h:65:10: fatal error:
'wx/wxprec.h' file not found
#include "wx/wxprec.h"

Building the project (or HyperNEAT)

I am trying to build HyperNEAT on OSX 10.10, but I think the README is a bit outdated?
When I download the project zipfile and extract it, i do not encounter a HyperNEAT/build directory. I do find a Cmakefiles.txt inside HyperNEAT-master/NE/HyperNEAT. I tried to run cmake on this dir as follows:

$ cmake HyperNEAT
which finishes apparently, but gives me some warnings about hardcoded paths:

CMake Warning (dev) at NEAT/CMakeLists.txt:116 (LINK_DIRECTORIES):
This command specifies the relative path

C:/ProgramData/NVIDIA Corporation/NVIDIA GPU Computing SDK/OpenCL/common/lib/x64

as a link directory.

There is a makefile generated, however running make without options fails almost immediately, running make -i gives a lot of errors, including fatal errors at 48% of the compilation process :(

I'm also noticing that quite a lot of things are being built that i will not necessarily need (i am trying to get a project up and running which needs HyperNEAT only)

Basically my question is, how can i build HyperNEAT only and how do I know when i have succesfully built it?

granting for use in LGPL software

Hi! I'm recently developing a program which play extinction-chess with MCTS, ANN and GA(https://github.com/jerrycheng567/extinction_chess). However, It doesn't work with simple feed-forward ANN, no matter I back-prop it in game or not...So i do a little research and found your work, however, my program is in LGPL3, and I saw the line(LGPL may be granted upon request)... May I use it for my LGPL program?

Build failed linker error

$ uname -a
Linux titanic 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux
$ ./build.sh
Builiding HyperNEAT
[  8%] Built target CakeFixedDepthLib
[ 10%] Built target ClicheExe
[ 12%] Built target ClicheLib
Scanning dependencies of target NEATLib_pch_dephelp
[ 13%] Building CXX object NEAT/CMakeFiles/NEATLib_pch_dephelp.dir/NEATLib_pch_dephelp.cxx.o
Linking CXX static library ../../../out/libNEATLib_pch_dephelp.a
[ 13%] Built target NEATLib_pch_dephelp
[ 14%] Generating NEAT_Defines.h.gch/NEATLib_Release.h++
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crt1.o: In function `_start':
/build/glibc-h_iKOs/glibc-2.19/csu/../sysdeps/x86_64/start.S:118: undefined reference to `main'
collect2: error: ld returned 1 exit status
NEAT/CMakeFiles/pch_Generate_NEATLib.dir/build.make:53: recipe for target 'NEAT/NEAT_Defines.h.gch/NEATLib_Release.h++' failed
make[2]: *** [NEAT/NEAT_Defines.h.gch/NEATLib_Release.h++] Error 1
CMakeFiles/Makefile2:285: recipe for target 'NEAT/CMakeFiles/pch_Generate_NEATLib.dir/all' failed
make[1]: *** [NEAT/CMakeFiles/pch_Generate_NEATLib.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
$

Arch Linux build issues (patched)

I've had some issues building the library with GCC on Arch Linux 2020, so I've updated the build script to patch some source files and use the zlib and boost installed by pacman.
I've also patched it to use wxWidgets version 3.0 and Python 3.8

  1. -stdlib=libstdc++
    As mentioned here, this flag causes compiling issues with GCC. The patch removes all entries on CMakeLists.txt files.

  2. Board -fPIC
    When compiling with BUILD_PYTHON, there was an issue "relocation R_X86_64_PC32 against symbol can not be used when making a shared object" with Board. The patch adds the -fPIC to the cmake command for this library. Thought I'm not sure it affects the code.

  3. zlib, zlib_d
    The zlib installed by pacman is linked with -lz. The patch fixes the names on CMakeLists.txt files.

  4. typedef void *gzFile
    On the current zlib version, this is typedef struct gzFile_s *gzFile. The patch changes it on tinyxmlplus.h.

  5. SaveFileGZ() not saving, SaveFile() normal
    For some reason, the "9wb+" option with the current zlib::gzopen won't create a file. I found that taking the + out it works. The patch changes it to "9wb" on tinyxmlplus.cpp.

  6. shared_ptr ambiguous
    Some shared_ptr across the source are missing the boost:: namespace. The patch fixes all files it finds.

  7. mutex ambiguous
    Some mutex across the source are missing the boost:: namespace. The patch fixes all files it finds.

  8. GtpInputStream::GetLine
    The compiler needs an explicit cast from istream to bool, so the patch changes the return to return (bool) getline(m_in, line) on fuego-0.4/gtpengine/GtpInputStream.cpp.

  9. SgGameReader::GetIntProp
    The compiler needs an explicit cast from istringstream to bool, so the patch changes the return to return (bool) in; on fuego-0.4/smartgame/SgGtpClient.cpp.

  10. boost -mt-d, -mt
    I don't really know why these flags are added to the boost library names, I guess it's related to the boost that's part of the repo. The patch removes them, and also removes the '-' character after each boost lib name.

  11. wxOPEN, wxFILE_MUST_EXIST, wxSAVE
    As mentioned here these have changed respectively to wxFD_OPEN, wxFD_FILE_MUST_EXIST and wxFD_SAVE.

  12. OnlyGaussianHiddenNodes 0.0
    This one took me a while to figure out, but the .dat file I was using as template didn't have this parameter, so the experiment would randomly crash.

Here is the patch shell script, it might be helpful for someone. (rename to .sh)

I'm using it as a lib for my software, so I can't tell if all the methods and experiments are working, especially the ones about Checkers/Go. But it's worth the try.

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.