gotopy/

directory
v0.0.0-...-209db18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2024 License: BSD-3-Clause

README

This directory has info and tools for converting Go-based simulation projects to Python.

GoToPy

GoToPy does a first pass conversion of Go syntax to Python syntax: https://github.com/go-python/gotopy

$ go get github.com/go-python/gotopy

This does the install directly, so the gotopy executable should be in your ~/go/bin directory, which you should add to your PATH if not already. Check by typing: which gotopy for example.

To run directly:

$ gotopy -gogi mysim.go > mysim.py

The -gogi option is important for enabling extra conversions for the GoGi gui system.

leabra-to.py

This Python program does additional steps specific to Leabra sims to attempt to get the code closer to usable. To prepare, run:

$ pip3 install -r requirements.txt

You can copy this file to an appropriate place on your path, e.g.:

$ cp leabra-to.py /usr/local/bin

and then run it:

$ leabra-to.py mysim.go

which generates a file named mysim.py -- important: will overwrite any existing!

After running, you will need to fix the start and end by copying from an existing project that is similar (use ra25 if nothing else), with the CB callback functions at the top, and the tbar.AddAction calls in ConfigGui at the end that call these callbacks instead of the inline code. There may be other errors which you can discover by running it -- there is a diminishing returns point on this conversion process so it is not designed to be complete.

Directories

Path Synopsis
ra25 runs a simple random-associator four-layer leabra network that uses the standard supervised learning paradigm to learn mappings between 25 random input / output patterns defined over 5x5 input / output layers (i.e., 25 units)
ra25 runs a simple random-associator four-layer leabra network that uses the standard supervised learning paradigm to learn mappings between 25 random input / output patterns defined over 5x5 input / output layers (i.e., 25 units)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL