Giter Site home page Giter Site logo

obsidian6s / digging Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opendilab/digging

0.0 0.0 0.0 6.4 MB

Decision Intelligence for digging best parameters in target environment.

Home Page: https://opendilab.github.io/DIgging/main/index.html

License: Apache License 2.0

Shell 3.42% Python 95.44% Makefile 1.14%

digging's Introduction

DIgging

icon

Twitter Style Test Docs Package

PyPI PyPI - Python Version codecov Loc Comments

GitHub Org's stars GitHub stars GitHub forks GitHub commit activity GitHub license

DIgging -- Decision Intelligence for digging better parameters in target function/environments.

Introduction

DIgging is a heuristic searching and optimization platform with various Decision Intelligence methods such as Genetic Algorithm, Bayesian Optimization and Reinforcement Learning etc. It can be used to digging better candidates to handle combinatorial optimization problems and non-gradient search problems.

DIgging is a fundamental platform under OpenDILab and it uses DI-engine to build RL searching pipelines.

Documentation

Outlines

Installation

You can simply install DIgging with pip command line from the official PyPI site.

pip install --user digging
python -c 'import digging'

Or you can simply install it from the source code.

git clone git clone https://github.com/opendilab/DIgging.git
cd DIgging
pip install --user .
python -c 'import digging'

It will automatically install DI-engine together with its requirement packages i.e. PyTorch.

Quick start

DIgging defines core algorithm and searching methods as Digger. You can define a Digger with a searching Space, and can be modified by a config dict. DIgging provides two kinds of searching pipeline for a target function. Thet are listed as follow.

  1. Interactive Procedure

It is done by calling Digger's propose and update_score method, in which you can flexibly define the searching procedures. You can call the provide_best method at any time to see the currently best candidate sample and its score. Here's an simple example:

def target_func(x):
    ...
	return score

space = YourSpace(shape=(...))
digger = YourDigger(config, space)

for i in range(max_iterations):
    samples = digger.propose(sample_num)
    scores = [target_func(x) for x in samples]
    digger.update_score(samples, scores)

print(digger.provide_best())
  1. Functional Procedure

It is done by calling the search method of Digger, with target function provided as input. The digger will automatically search the best samples of the target according to the config. Here's an example:

def target_func(x):
    ...
    return score

space = YourSpace(shape=(...))
digger = YourDigger(config, space)

digger.search(target_func)

print(digger.provide_best())
  1. Reinforcement Learning Procedure

When using a Reinforcement Learning Digger, users need to provide an RL Policy defined in DI-engine form, and some other RL workers in DI-engine such as Collector, Learner, ReplayBuffer are supposed to be used in the Digger. In the searching procedure, a target Env is used instead of a function. So we suggest to use the search method to if the user is not familiar with the RL pipeline of DI-engine. Here's an example.

def target_func(x):
    ...
    return score

rl_config = EasyDict(dict(...))
space = YourSearchSpace(shape=(...))
policy = YourPolicy(rl_config.policy, ...)
digger = RLDigger(rl_cfg, space, policy)

digger.search(target_func)

print(digger.provide_best())

Digging Method Zoo

  • Genetic Algorithm
  • Bayesian Optimization
  • RL

License

DIgging is released under the Apache 2.0 license.

digging's People

Contributors

paparazz1 avatar robinc94 avatar

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.