https://github.com/akiross/go-gsgp
Geometric Semantic Genetic Programming ported to Go
https://github.com/akiross/go-gsgp
genetic-programming numerical-optimization optimization-algorithms
Last synced: about 1 month ago
JSON representation
Geometric Semantic Genetic Programming ported to Go
- Host: GitHub
- URL: https://github.com/akiross/go-gsgp
- Owner: akiross
- License: agpl-3.0
- Created: 2017-02-09T13:52:43.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-11-16T23:23:44.000Z (over 7 years ago)
- Last Synced: 2024-06-20T14:28:55.234Z (over 1 year ago)
- Topics: genetic-programming, numerical-optimization, optimization-algorithms
- Language: Go
- Size: 548 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# go-gsgp
Geometric Semantic Genetic Programming ported to Go
The original code (by Mauro Castelli) is available at http://gsgp.sf.net
This version is compatible with the version 1.0 and features:
- shorter, safer Go code;
- better reading of configuration files;
- better handing of command line arguments.
# Building
To generate protobuf code, get protobuf on your host, then
go get github.com/golang/protobuf/protoc-gen-go
To include git version number, compile using:
go build -ldflags "-X main.gitCommit=`git describe --long --dirty --tags --always`"
The commit will show up when running with `-version` flag.
# Usage
go get github.com/akiross/go-gsgp
$GOPATH/bin/go-gsgp -train_file train_dataset -test_file test_dataset
To change parameters, edit the `configuration.ini` file.
The train and test files have the following format:
n_VARS
m_EXAMPLES
V11 V12 V3 ... V1n T
V21 V22 V3 ... V2n T
...
Vm1 Vm2 V3 ... Vmn T
Where, the first line contains the number `n` of variables, the second line
contains the number `m` of cases in the dataset. Then, follow `m` lines of
`n+1` space-separated columns, where the last column is the target value.
# Initialization via semantic feeding
Instead of randomly generating all the initial individuals, and computing
their semantic, it is possible to feed some pre-computed semantics via files.
To do so, provide a list of files as positional arguments to the program:
$ go-gsgp [options] semantic1 semantic2 ... semanticN
The files consist in a semantic vector with one value per line. The file shall
contain the semantic values for the training set followed by the test values.