Giter VIP home page Giter VIP logo

mltests's Introduction

mltests

About

Hi all,

This is a project with the loose goal of finding interesting ways to generate intelligent agents through trial and error. There are currently distinct Python and C++ architectures, each with a default basic spiking neural network and a experimental frequency-domain based spiking neural network. This document includes instructions on how to work with each architecture. The docker development environment is intended for use with the python architecture. Here is a showcase video, showing the behavior of some of the topologies stored in this repository: https://www.youtube.com/watch?v=zFZZjQkz7RA

Building dev Docker image

To set up the mltests dev environment with Docker, run the following commands in bash:

cd mltests
docker build -t mltests-dev .

vscodium and vim are included by default, feel free to add your own editor to the Dockerfile to suit your own preferences. In GUI mode, you can use vscodium! Git is included by default, so you can use git directly with your own fork of the mltests project from inside the Docker container.

Running dev Docker image with GUI(Recommended)

xhost +SI:localuser:root
docker run  -e DISPLAY=$DISPLAY \
            -v /tmp/.X11-unix:/tmp/.X11-unix:rw \
            --ipc=host \
            --user 0:0 \
            --cap-drop=ALL \
            --security-opt=no-new-privileges \
	    -it \
            mltests-dev

Adapted from https://github.com/mviereck/x11docker/wiki/Short-setups-to-provide-X-display-to-container.

Please note that this breaks container isolation!

Running dev Docker image without GUI:

docker run -it --user 0:0  mltests-dev

Revisting Existing Docker session

To determine the name of your session, get a list of docker processes with

docker ps -a

If the Docker session you are starting needs graphical windows, you will need the following line:

xhost +SI:localuser:root

Then to start the session (with changes saved) type:


docker start -a -i <session name>

This is an important idea to get the hang of, since building from scratch pulls from the online git repo.

Python architecture

cd python_neuro_ev
python3 ./main.py <mode> <environment> <learning_algorithm> <file_name>

modes:

train

runs neuro-evolution from scratch, saving generated toplogy to ./log.txt

improve

runs neuro-evolution, starting from an existing topology, and saves to ./log.txt as higher-scoring topologies are found

analyze

provides a visualization of the performance of the toplogy specified by the provided file on the microworld task.

environments:

cartpole chopper berzerk xor biped pshoppe sologrid

C++ architecture

enter the following commands in bash, from the project directory

make
chmod +x ./test
cd ./microworld1
make
chmod +x ./microworld1
cd ../microworld2
make
chmod +x ./microworld2
You're good to go!

microworlds 1 and 2 can be run from the command line in three modes

./microworld1 train

runs neuro-evolution from scratch, saving generated toplogy to ./log.txt

./microworld1 improve <file_name>

runs neuro-evolution, starting from an existing topology, and saves to ./log.txt as higher-scoring topologies are found

./microworld1 analyze <file_name>

provides a visualization of the performance of the toplogy specified by the provided file on the microworld task.

Contact Information

If any of these areas sound interesting to you, don't hesitate to contribute. I can be reached at balisujohn at gmail dot com and other contributors can be reached at their emails if they have provided them. We are very interested in recieving input and contributions.

Contributors:
John Balis: balisujohn at gmail dot com
William Derksen
Michael Ivanitskiy: mivanits at umich dot edu OR mivanitskiy at hotmail dot com

Inline dependencies:
cJSON, courtesy of Dave Gamble and cJSON contributors

mltests's People

Contributors

ajonstewart avatar aquarial avatar balisujohn avatar johnbalis avatar johnubalis avatar juicyslew avatar mivanit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mltests's Issues

Compiler error: async is a keyword

I get a compiler error pointing to visulization.py Line 60 which passes async = True to a function.

async is a keyword in python now, so this won't compile. I deleted the argument locally and it seemed to work normally.

[nix-shell] $ python3 --version
Python 3.7.3

[nix-shell] $ python3 ./base_SNN/main.py train cartpole default
Traceback (most recent call last):
  File "./base_SNN/main.py", line 1, in <module>
    import learning
  File "mltests/python_neuro_ev/base_SNN/learning.py", line 3, in <module>
    import brain
  File "mltests/python_neuro_ev/base_SNN/brain.py", line 14, in <module>
    import visualization 
  File "./visualization.py", line 60
    win = GraphWindow(g,pos, async = True,  geometry =(500,400) ,vertex_text=g.vertex_index, vertex_font_sizcolor = color_map)
                                 ^
SyntaxError: invalid syntax

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.