karoo_gp/README.md

189 lines
4.7 KiB
Markdown

# SpaceCruft Fork
This is a SpaceCruft fork of https://github.com/kstaats/karoo_gp
# Karoo GP
Karoo GP is an evolutionary algorithm, a genetic programming application suite written in Python which supports both
symbolic regression and classification data analysis. It is ready to work with your datasets, is multicore and GPU
enabled by means of the powerful library TensorFlow. The packge includes a Desktop application with an intuitive user
interface, and a Server application which supports fully scripted runs. Output is automatically archived. Batteries
included. No programming required.
For an interesting read on scalar vs vector, and CPU vs GPU performance with Karoo GP:
https://arxiv.org/abs/1708.03157
Be certain to read the User Guide!!!
Learn more at <a href="http://kstaats.github.io/karoo_gp/">kstaats.github.io/karoo_gp/</a> ...
# Debian Install
To install on Debian (Buster/Stable/10):
```
# Install Dependencies:
sudo apt install python3 python3-pip python3-venv
# Clone repo (choose this one or upstream):
# git clone https://github.com/kstaats/karoo_gp
git clone https://spacecruft.org/spacecruft/karoo_gp
# Setup
cd karoo_gp
python3 -m venv .venv
source .venv/bin/activate
# Install python dependencies
pip3 install wheel
pip3 install numpy==1.16.4 sympy==1.4 tensorflow==1.13.1 scikit-learn==0.21.2
# Run application
python3 karoo_gp.py
```
# Tensorflow 2 Install
Using karoo_gp with Tensorflow 2 on Debian (Buster/Stable/10).
```
# Install Dependencies:
sudo apt install python3 python3-pip python3-venv
# Clone repo (choose this one or upstream):
# git clone https://github.com/kstaats/karoo_gp
git clone https://spacecruft.org/spacecruft/karoo_gp
# Setup
cd karoo_gp
python3 -m venv .venv
source .venv/bin/activate
pip3 install --upgrade pip
pip3 install --upgrade setuptools
# Install python dependencies
pip3 install wheel
pip3 install sklearn sympy
# This will install Tensorflow 2.1:
pip3 install tensorflow
# Run application
python3 karoo_gp.py
```
# Jupyter
Jupyter is a cute interface to python.
## Jupyter Install
To install everything for jupyter, not in virt env... Thusly:
```
# Install Dependencies:
sudo apt install python3 python3-pip
# Clone repo (choose this one or upstream):
git clone https://spacecruft.org/spacecruft/karoo_gp
# Setup
cd karoo_gp
git checkout jupyter
pip3 install --user --upgrade pip
pip3 install --user --upgrade setuptools
# Install python dependencies
pip3 install --user wheel
pip3 install --user sklearn sympy
# This will install Tensorflow 2.1:
pip3 install --user tensorflow
```
## Run Jupyter
Copy the `foo` to an appropriate place. Run similar to this:
```
jupyter-lab \
--config=/home/jebba/.jupyter/jupyter_karoo_gp_config.py \
--debug \
--notebook-dir=/home/jebba/devel/spacecruft/karoo_gp \
--app-dir=/home/jebba/.local/share/jupyter/lab \
1>>/home/jebba/log/karoo.log 2>>/home/jebba/log/karoo.err &
```
# Voila
Voila can take Jupyter notebooks and turn them into websites.
Example site below:
* https://karoo.spacecruft.org/
## Install Voila
See other docs, maybe in satnogs-wut.
```
# Install Dependencies:
sudo apt install python3 python3-pip python3-venv
# Clone repo:
git clone https://spacecruft.org/spacecruft/karoo_gp
# Setup
cd karoo_gp
git checkout jupyter
pip3 install --user --upgrade pip
pip3 install --user --upgrade setuptools
# Install python dependencies
pip3 install --user wheel
pip3 install --user sklearn sympy
# This will install Tensorflow 2.1:
pip3 install --user tensorflow
```
## Voila Apache
Snippet of apache code to set up proxy using Certbot.
```
<VirtualHost karoo.spacecruft.org:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
RequestHeader set X-Forwarded-Proto 'https'env=HTTPS
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule /(.*) ws://127.0.0.1:8221/$1 [P]
<Location />
ProxyPass http://127.0.0.1:8221/
</Location>
ProxyVia On
ProxyPreserveHost On
Include /etc/letsencrypt/options-ssl-apache.conf
ServerName karoo.spacecruft.org
SSLCertificateFile /etc/letsencrypt/live/wut.spacecruft.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/wut.spacecruft.org/privkey.pem
</VirtualHost>
```
## Voila Start
Start with `voila` something like this:
```
voila \
--ExecutePreprocessor.timeout=600 \
--no-browser \
--port=8221 \
--theme=dark \
--autoreload=True \
--template=default \
--Voila.ip=localhost \
--VoilaConfiguration.enable_nbextensions=False \
karoo_gp.ipynb
```