Coder Social home page Coder Social logo

scoutopt's Introduction

Scout Optimizer

Scout is a Bayesian optimizer designed to be as easy to use as possible by limiting the number of options and tuning parameters through the use of experts and internal searches to determine appropriate configurations. The only parameters needed to run an optimization with scout, is the objective function, the problem design variable bounds, and the evaluation budget. The goal of Scout is to produce the best possible solution given the evaluation budget. The primary use case for Scout is on expensive black box functions where only a limited number of of function evaluations are possible.

Installation

Scout can be installed directly from Github using pip

pip install git+https://github.com/jldaniel/ScoutOpt.git

or by downloading the source code and calling pip on the directory.

git clone https://github.com/jldaniel/ScoutOpt.git
pip -e install ScoutOpt

Usage

Scout can be used by importing the module, creating a new Scout object, setting the problem and bounds, then simply calling optimize and providing an evaluation budget.

import numpy as np
from scout import Scout

# This is the loss function we are going to optimize
def gramacy_lee(x):
    return np.sin(10 * np.pi * x) / (2 * x) + np.power(x - 1., 4.)

# The input variable bounds for the loss function
bounds = np.array([[0.5, 2.5]])

# The total number of function evaluations to perform during the search
evaluation_budget = 30

# Set up the optimizer
opt = Scout(gramacy_lee, bounds, seed=42)

# Run the optimization
x_best, y_best = opt.optimize(evaluation_budget)

# Display the results
print('Best x: ' + repr(x_best))
print('Best y: ' + repr(y_best))

Algorithm

Scout uses the following algorithm

  1. Given the evaluation budget, select a portion to use as an initial training set for a surrogate model.
  2. A mixed design of experiments is generated combining a regular full-factorial design and a random latin-hypercube design
  3. An initial surrogate model is trained using Gaussian process regression and an grid search to determine the best kernel
  4. For the remaining evaluation budget a new point is selected via an attainment function which initially favors exploration of the design space then gradually shifts to prefer exploitation of the objective.
  5. As each new point is evaluated, the surrogate is updated

scoutopt's People

Contributors

jldaniel avatar

Watchers

James Cloos avatar  avatar

scoutopt's Issues

Warmstart

Allow for the algorithm to be run for more iterations in hopes of obtaining better objective values.

User Stories

  1. As an Engineer I want to continue the search process beyond my initial evaluation budget in order to obtain better solutions

Initial training set

Allow for users to pass in an initial training set to the optimizer. This feature will need to work with the initial DOE generation process and the size of the training budget to ensure that a good initial surrogate is generated.

User Stories

  1. As an Engineer I want to utilized data I have already generated for the search process so that I can obtain better solutions.

Constrained Optimization

Add in the ability to add output variable constraints to the optimization

User Stories

  1. As an Engineer I want to the optimization to respect output constraints so that I can use Scout for a wider array of problems.

Results object

Package the results and search history into an object to return when then optimization completes.

User Story:

  1. As an Engineer I want more detailed results from the optimization run so that I can better understand the search process.

Kernel search options

Add in additional options for the kernel search process in the Surrogate. Utilizing the Sum and Product sklearn kernels, combinations of kernels could be created to hopefully provide a better overall kernel for the regressor.

User Stories

  1. As an Engineer I want to obtain better solution with fewer evaluations so that I can do my job more efficiently.

Batch Mode

Allow Scout to operate in an interactive or "online" mode where batches of points are used instead of single points. In this case the actual function handle is not needed, just sets of data points suggested and supplied.

User Stories

  1. As an Engineer I want to use Scout as data becomes available to me so that I don't have to supply a function handle.

Logging

Add in logging to scout. The standard python logging module should suffice to allow for a logger configuration to be passed in to enable the different use cases.

User Stories:
  1. As a Scout User I want to see console output of scout's progression in order to have insight into the optimizer's progress
  2. As a Scout Developer I want insights into what scout is doing to in order to aid in the development and debugging process.
  3. As a Tool Developer I want to be able to expose scout's behavior to my tool that utilizes scout in order to provide a better user experience.

Maximize loss function

Add in an option to maximize the loss function instead of just minimizing it or requiring users to modify their function.

User Stories

  1. As an Engineer I was to easily be able to maximize my objective function so that I can do my job more easily.

Save optimization

Add in the capability for the optimization to be saved to disk.

User Stories

  1. As an Engineer I want to be able to save checkpoints of the algorithm so that I can restart the optimization in case of equipment failure.
  2. As an Engineer I want to be able to save the results of my optimization so that I can reference them later.
  3. As an Engineer I want to be able to save and restore an optimization run so that I can continue the search process.

Improve kernel search

The current kernel search process is just a grid search and adding more kernel options will only further the total run time of the optimizer. More advanced searches could be done such as a discrete optimization or utilizing Exploratory Landscape Analysis to train a classifier to help the search.

User Stories

  1. As an Engineer I want to obtain better solutions faster so that I can do my job more efficiently
  2. As an Engineer I want to use Scout for a wide variety of problems so that I can simplify my analysis pipeline.

References

https://arxiv.org/pdf/1610.00907.pdf
https://www.cs.toronto.edu/~duvenaud/thesis.pdf
https://www.coseal.net/ela/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.