Skip to main content

GUI for MG-PSO

Project description

Multigroup PSO GUI

This application provides an interface for setting up, configuring, running, and the visualization of multigroup PSO training.

Instructions for Ubuntu

To run the interface you must also install Tkinter:

sudo apt install python-tk

To install the interface simply run:

python3 -m pip install mg-pso-gui

Once the package is downloaded and install run this command to open the interface:

mgpsogui

You may need to add a folder to PATH.

Note: If you run into an error saying that PIL.Image was not able to be imported on Ubuntu please force reinstall Pillow.

python3 -m pip install --upgrade --force-reinstall Pillow

Instructions for Windows

Download and install Python 3.10 through the Microsoft Store, this makes Python easily accessible in Windows Terminal.

Once installed run this command to install the interface:

python3 -m pip install mg-pso-gui

You may need to add the folder the application was downloaded to into PATH. At the end of the installation message it will say the folder location (e.g. C:\Users\robertcordingly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts). After adding that location to PATH, you can use this command to open the interface:

mgpsogui

If you did not add the directory to PATH, it can be ran like this:

C:\Users\robertcordingly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts\mgpsogui.exe

Instructions for MacOS

To install Tkinter and Python 3 it is best to use Homebrew:

Install Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install Python3 and Tkinter

brew install python3
brew install tkinter

Then install MG PSO Gui:

python3 -m pip install mg-pso-gui

You may need to add /Library/Frameworks/Python.framework/Versions/3.10/bin to path to run the interface with 'mgpsogui,' otherwise run the interface:

/Library/Frameworks/Python.framework/Versions/3.10/bin/mgpsogui

Getting Started

After getting the GUI to launch, it is first recommended to start with one of the default config files. Default config files are available here: https://drive.google.com/file/d/1Ra4Um7KgCghMidyrrLrD6wFSXJZd3zkX/view?usp=share_link

To load a config simply click the "load" button in the left side bar and select the file using the file picker. After a config has been loaded, enter a service URL, and click "Connect". If the connection is successful the other tabs on the interface will be unlocked and you will have full access to all of the interface's features.

Tab Overview

Each tab of the interface serves a different purpose described here.

Platform

The platform tab is where you defined the backend service used to train the model. If the service already exists, simply add the URL to the service field and press connect to get parameters from the service. After doing this the other tabs will unlock.

If you do not already have a backend service deployed, the platform tab provides tools to create a local environment using Docker and Minikube.

Setup

The setup tab is where all parameters about the training process are defined. The Group Editor allow you to define groups, the parameters each group uses, and the functions used. The available parameters are defined by the service.

Alongside the Group Editor is the Static Parameter and Calibration Parameter editors. These editors allow further customization of the training process.

Run

The run tab allows you to start the training process, stop it, and view the progress. If there is an error in the training process information will be shown in the text box.

Visualize

The Visualize tab allows you to generate a variety of different graphs and tables. Some graphs are filled in while the training process occurs while other require full steps to complete training. To export and further view graphs the "Open in Browser" allows a figure to be opened in your default web browser and open and interactive version of the graph.

Example Configuration

{
    "arguments": {
        "param": [
            {
                "name": "startTime",
                "value": "2002-01-01"
            },
            {
                "name": "endTime",
                "value": "2006-12-31"
            },
            {
                "name": "dataStartTime",
                "value": "2002-01-01"
            },
            {
                "name": "dataEndTime",
                "value": "2006-12-31"
            },
            {
                "name": "cal_startTime",
                "value": "2003-01-01"
            },
            {
                "name": "cal_endTime",
                "value": "2006-12-31"
            },
            {
                "name": "parallelismThreads",
                "value": "2"
            },
            {
                "name": "flagLoadState",
                "value": "True"
            },
            {
                "name": "payload",
                "value": "false"
            },
            {
                "name": "project",
                "value": "SFIR3"
            }
        ],
        "url": "http://csip.engr.colostate.edu:8087/csip-oms/m/ages/0.3.0",
        "files": {}
    },
    "calibration_parameters": [
        {
            "name": "min_rounds",
            "value": "1"
        },
        {
            "name": "max_rounds",
            "value": "2"
        },
        {
            "name": "n_particles",
            "value": "10"
        },
        {
            "name": "iters",
            "value": "20"
        },
        {
            "name": "n_threads",
            "value": "10"
        },
        {
            "name": "ftol",
            "value": "NULL"
        },
        {
            "name": "options_c1",
            "value": "2"
        },
        {
            "name": "options_c2",
            "value": "2"
        },
        {
            "name": "options_w",
            "value": "0.8"
        },
        {
            "name": "strategy_w",
            "value": "adaptive"
        },
        {
            "name": "strategy_c1",
            "value": "adaptive"
        },
        {
            "name": "strategy_c2",
            "value": "adaptive"
        },
        {
            "name": "service_timeout",
            "value": "400"
        },
        {
            "name": "http_retry",
            "value": "5"
        },
        {
            "name": "allow_redirects",
            "value": "True"
        },
        {
            "name": "async_call",
            "value": "False"
        },
        {
            "name": "conn_timeout",
            "value": "10"
        },
        {
            "name": "read_timeout",
            "value": "400"
        },
        {
            "name": "particles_fail",
            "value": "5"
        }
    ],
    "steps": [
        {
            "param": [
                {
                    "name": "soilOutLPS",
                    "bounds": [
                        0.0,
                        2.0
                    ]
                },
                {
                    "name": "lagInterflow",
                    "bounds": [
                        10.0,
                        80.0
                    ]
                }
            ],
            "objfunc": [
                {
                    "name": "ns",
                    "of": "ns",
                    "weight": 1.0,
                    "data": [
                        "obs_data02_14.csv/obs/orun[1]",
                        "output/csip_run/out/Outlet.csv/output/catchmentSimRunoff"
                    ]
                }
            ]
        },
        {
            "param": [
                {
                    "name": "flowRouteTA",
                    "bounds": [
                        0.4,
                        5.0
                    ]
                },
                {
                    "name": "soilMaxDPS",
                    "bounds": [
                        0.0,
                        5.0
                    ]
                }
            ],
            "objfunc": [
                {
                    "name": "ns",
                    "of": "ns",
                    "weight": 1.0,
                    "data": [
                        "obs_data02_14.csv/obs/orun[1]",
                        "output/csip_run/out/Outlet.csv/output/catchmentSimRunoff"
                    ]
                }
            ]
        }
    ]
}

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mg_pso_gui-0.1.240.tar.gz (97.2 kB view details)

Uploaded Source

Built Distribution

mg_pso_gui-0.1.240-py3-none-any.whl (123.2 kB view details)

Uploaded Python 3

File details

Details for the file mg_pso_gui-0.1.240.tar.gz.

File metadata

  • Download URL: mg_pso_gui-0.1.240.tar.gz
  • Upload date:
  • Size: 97.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for mg_pso_gui-0.1.240.tar.gz
Algorithm Hash digest
SHA256 5a46a46b17810ed4835dd4400a94a4e9cc84c1ddf7871dfc2d767174243de409
MD5 418dfdbb4e6c88e2c18f1eaec6625706
BLAKE2b-256 1d7eceddfb0a672f130a6997a1063d2d2cfb20444f07a72460f0b6c4b7551bdd

See more details on using hashes here.

File details

Details for the file mg_pso_gui-0.1.240-py3-none-any.whl.

File metadata

  • Download URL: mg_pso_gui-0.1.240-py3-none-any.whl
  • Upload date:
  • Size: 123.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for mg_pso_gui-0.1.240-py3-none-any.whl
Algorithm Hash digest
SHA256 41d0785c6f633aceee6ce017b8287c4a687add8db23de5d840eda3146835d980
MD5 cb7f4b31b4e3961f3ae8c9f2329cc420
BLAKE2b-256 f69f69710d3d66e7c3168fea170783278920ad703ffe797c4ea59edc32169a72

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page