• Stars
    star
    1,542
  • Rank 30,345 (Top 0.6 %)
  • Language
    Jupyter Notebook
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Open-source implementation of Google Vizier for hyper parameters tuning

Advisor

Introduction

Advisor is the hyper parameters tuning system for black box optimization.

It is the open-source implementation of Google Vizier with these features.

  • Easy to use with API, SDK, WEB and CLI
  • Support abstractions of Study and Trial
  • Included search and early stop algorithms
  • Recommend parameters with trained model
  • Same programming interfaces as Google Vizier
  • Command-line tool just like Microsoft NNI.

Supported Algorithms

  • Grid Search
  • Random Search
  • Bayesian Optimization
  • TPE(Hyperopt)
  • Random Search(Hyperopt)
  • Simulate Anneal(Hyperopt)
  • Quasi Random(Chocolate)
  • Grid Search(Chocolate)
  • Random Search(Chocolate)
  • Bayes(Chocolate)
  • CMAES(Chocolate)
  • MOCMAES(Chocolate)
  • SMAC Algorithm
  • Bayesian Optimization(Skopt)
  • Early Stop First Trial Algorithm
  • Early Stop Descending Algorithm
  • Performance Curve Stop Algorithm

Quick Start

It is easy to setup advisor service in local machine.

pip install advisor

advisor_admin server start

Then go to http://127.0.0.1:8000 in the browser and submit tuning jobs.

git clone --depth 1 https://github.com/tobegit3hub/advisor.git && cd ./advisor/

advisor run -f ./advisor_client/examples/python_function/config.json

advisor study describe -s demo

Advisor Server

Run server with official package.

advisor_admin server start

Or run with official docker image.

docker run -d -p 8000:8000 tobegit3hub/advisor

Or run with docker-compose.

wget https://raw.githubusercontent.com/tobegit3hub/advisor/master/docker-compose.yml

docker-compose up -d

Or run in Kubernetes cluster.

wget https://raw.githubusercontent.com/tobegit3hub/advisor/master/kubernetes_advisor.yaml

kubectl create -f ./kubernetes_advisor.yaml

Or run from scratch with source code.

git clone --depth 1 https://github.com/tobegit3hub/advisor.git && cd ./advisor/

pip install -r ./requirements.txt

./manage.py migrate

./manage.py runserver 0.0.0.0:8000

Advisor Client

Install with pip or use docker container.

pip install advisor

docker run -it --net=host tobegit3hub/advisor bash

Use the command-line tool.

export ADVISOR_ENDPOINT="http://127.0.0.1:8000"

advisor study list

advisor study describe -s "demo"

advisor trial list --study_name "demo"

Use admin tool to start/stop server.

advisor_admin server start

advisor_admin server stop

Use the Python SDK.

client = AdvisorClient()

# Create the study
study_configuration = {
        "goal": "MAXIMIZE",
        "params": [
                {
                        "parameterName": "hidden1",
                        "type": "INTEGER",
                        "minValue": 40,
                        "maxValue": 400,
                        "scalingType": "LINEAR"
                }
        ]
}
study = client.create_study("demo", study_configuration)

# Get suggested trials
trials = client.get_suggestions(study, 3)

# Complete the trial
trial = trials[0]
trial_metrics = 1.0
client.complete_trial(trial, trial_metrics)

Please checkout examples for more usage.

Configuration

Study configuration describe the search space of parameters. It supports four types and here is the example.

{
  "goal": "MAXIMIZE",
  "randomInitTrials": 1,
  "maxTrials": 5,
  "maxParallelTrials": 1,
  "params": [
    {
      "parameterName": "hidden1",
      "type": "INTEGER",
      "minValue": 1,
      "maxValue": 10,
      "scalingType": "LINEAR"
    },
    {
      "parameterName": "learning_rate",
      "type": "DOUBLE",
      "minValue": 0.01,
      "maxValue": 0.5,
      "scalingType": "LINEAR"
    },
    {
      "parameterName": "hidden2",
      "type": "DISCRETE",
      "feasiblePoints": "8, 16, 32, 64",
      "scalingType": "LINEAR"
    },
    {
      "parameterName": "optimizer",
      "type": "CATEGORICAL",
      "feasiblePoints": "sgd, adagrad, adam, ftrl",
      "scalingType": "LINEAR"
    },
    {
      "parameterName": "batch_normalization",
      "type": "CATEGORICAL",
      "feasiblePoints": "true, false",
      "scalingType": "LINEAR"
    }
  ]
}

Here is the configuration file in JSON format for advisor run.

{
  "name": "demo",
  "algorithm": "BayesianOptimization",
  "trialNumber": 10,
  "concurrency": 1,
  "path": "./advisor_client/examples/python_function/",
  "command": "./min_function.py",
  "search_space": {
      "goal": "MINIMIZE",
      "randomInitTrials": 3,
      "params": [
          {
              "parameterName": "x",
              "type": "DOUBLE",
              "minValue": -10.0,
              "maxValue": 10.0,
              "scalingType": "LINEAR"
          }
      ]
  }
}

Or use the equivalent configuration file in YAML format.

name: "demo"
algorithm: "BayesianOptimization"
trialNumber: 10
path: "./advisor_client/examples/python_function/"
command: "./min_function.py"
search_space:
  goal: "MINIMIZE"
  randomInitTrials: 3
  params:
    - parameterName: "x"
      type: "DOUBLE"
      minValue: -10.0
      maxValue: 10.0

Screenshots

List all the studies and create/delete the studies easily.

study_list.png

List the detail of study and all the related trials.

study_detail.png

List all the trials and create/delete the trials easily.

trial_list.png

List the detail of trial and all the related metrics.

trial_detail.png

Development

You can edit the source code and test without re-deploying the server and client.

git clone [email protected]:tobegit3hub/advisor.git

cd ./advisor/advisor_client/

python ./setup.py develop

export PYTHONPATH="/Library/Python/2.7/site-packages/:$PYTHONPATH"

More Repositories

1

seagull

Friendly Web UI to manage and monitor docker
JavaScript
1,931
star
2

tensorflow_template_application

TensorFlow template application for deep learning
Python
1,869
star
3

understand_linux_process

The open-source ebook of Understand Linux Process
Dockerfile
996
star
4

simple_tensorflow_serving

Generic and easy-to-use serving service for machine learning models
JavaScript
757
star
5

ml_implementation

Implementation of Machine Learning Algorithms
Python
389
star
6

lambda-docker

Event-driven code runtime like AWS Lambda service
Python
302
star
7

miniflow

Minimal numerical computation library with TensorFlow APIs
C
301
star
8

ceph_from_scratch

The practical book about ceph
Dockerfile
153
star
9

tensorflow_examples

TensorFlow Example Projects
Python
140
star
10

deep_image_model

Deep convolution/recurrent neural network project with TensorFlow
Python
100
star
11

openmldb-chatgpt-plugin

The ChatGPT plugin to enhance OpenMLDB.
Python
51
star
12

tobe-algorithm-manual

Tobe Algorithm Manual
Python
49
star
13

deep_q

Deep reinforcement learning with TensorFlow
Python
47
star
14

pirate

Private admin dashboard for docker distribution
Go
42
star
15

openspark

The out-of-the-box environment to for Hadoop/Spark applications
Dockerfile
39
star
16

tftvm

TensorFlow and TVM integration
C++
38
star
17

code_examples

The code for computer science
ANTLR
35
star
18

understand_linux_process_examples

Examples of Understand Linux Process
Go
34
star
19

enas_model

Automatically build the deep learning models with ENAS
Python
30
star
20

mycomputer

Share your enviable life
Go
27
star
21

tfmodel

Statically and dynamically inspect tool for TensorFlow models
Python
24
star
22

ceph-web

Web based management tool for ceph
Go
21
star
23

harbor-py

The missing harbor python SDK
Python
20
star
24

auto_imgaug

Automatical image augment with heuristic machine learning models
Python
18
star
25

mirror-dockerhub

Tools to mirror container images from docker hub
Shell
14
star
26

osop

OpenStack Operation automatical toolkits
Shell
13
star
27

hotpatch

Apply hot patches for running processes without restarting
C++
12
star
28

tuning_game

The hyper-parameters tuning and black box optimization games
Python
12
star
29

tensorflow_capsnet

TensorFlow implementation of CapsNet
Python
10
star
30

hplearn

High performance machine learning system
C++
8
star
31

gitsql

Query Git with SQL
Python
7
star
32

translate

Command-line translate tool, supported by Youdao
Ruby
6
star
33

tf_progress

Easy-to-use library for logging training progress of TensorFlow
Python
5
star
34

failover_paper

The paper of failover test framework for distributed system
4
star
35

nmenu

Customized Ncurses Menu Toolkit
Shell
2
star
36

openkube

The container with Kubernetes tools.
Dockerfile
2
star
37

NotATop

3D Android game of spinning top
Java
2
star
38

painter

The painter service to construct machine learning models easily
HTML
2
star
39

sparksql-magic

The notebook magic function for SparkSQL
Jupyter Notebook
2
star
40

PortableOpenMLDB

The portable OpenMLDB cluster which can be run anywhere without installation.
Shell
2
star
41

PyCss

Write CSS in pythonic way
Python
2
star
42

openmldb_lab

Enhanced web service for OpenMLDB
Vue
1
star
43

docs-project

The docs project for any project
1
star
44

PutsColor

The maven project to System.out.println colorful message easily
Java
1
star
45

hotdog-not-hotdog-app

Hot dog or not hot dog application with machine learning
Python
1
star
46

cmake_redis

CMake support for redis
Shell
1
star
47

android_control

Android control program with adb debugger
Python
1
star
48

rbac_book

The RBAC book about authentication and authorization
1
star
49

Childhood

The HTML5 video website to remind you of childhood
JavaScript
1
star
50

pm_simulator

PM(Project Manager) Simulator.
Python
1
star
51

AgentInsignt

The observable and managable platform for OpenAI Swarm-compatible agents.
1
star
52

mplayer

Android controller for embedded devices.
C
1
star