{"id":19287338,"url":"https://github.com/opendilab/digging","last_synced_at":"2025-04-22T04:32:04.381Z","repository":{"id":57795822,"uuid":"525295038","full_name":"opendilab/DIgging","owner":"opendilab","description":"Decision Intelligence for digging best parameters in target environment.","archived":false,"fork":false,"pushed_at":"2022-10-12T05:51:35.000Z","size":6622,"stargazers_count":102,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2023-11-07T17:25:16.392Z","etag":null,"topics":["bayesian-optimization","evolutionary-algorithm","reinforcement-learning","searching"],"latest_commit_sha":null,"homepage":"https://opendilab.github.io/DIgging/main/index.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opendilab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-16T08:35:48.000Z","updated_at":"2023-11-03T13:18:08.000Z","dependencies_parsed_at":"2022-08-28T02:41:25.556Z","dependency_job_id":null,"html_url":"https://github.com/opendilab/DIgging","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendilab%2FDIgging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendilab%2FDIgging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendilab%2FDIgging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendilab%2FDIgging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opendilab","download_url":"https://codeload.github.com/opendilab/DIgging/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223888463,"owners_count":17220083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian-optimization","evolutionary-algorithm","reinforcement-learning","searching"],"created_at":"2024-11-09T22:05:53.233Z","updated_at":"2024-11-09T22:05:53.878Z","avatar_url":"https://github.com/opendilab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DIgging\n\n\u003cimg src=\"./docs/figs/digging_banner.png\" alt=\"icon\"/\u003e\n\n[![Twitter](https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Ftwitter.com%2Fopendilab)](https://twitter.com/opendilab)\n[![Style](https://github.com/opendilab/digging/actions/workflows/style.yml/badge.svg)](https://github.com/opendilab/DIgging/actions/workflows/style.yml?query=workflow%3A%22Style+And+Badge%22)\n[![Test](https://github.com/opendilab/digging/actions/workflows/test.yml/badge.svg)](https://github.com/opendilab/DIgging/actions/workflows/test.yml?query=workflow%3A%22Code+Test%22)\n[![Docs](https://github.com/opendilab/digging/actions/workflows/doc.yml/badge.svg)](https://github.com/opendilab/DIgging/actions/workflows/doc.yml?query=workflow%3A%22Docs+Deploy%22)\n[![Package](https://github.com/opendilab/digging/actions/workflows/release.yml/badge.svg)](https://github.com/opendilab/DIgging/actions/workflows/release.yml?query=workflow%3A%22Package+Release%22)\n\n[![PyPI](https://img.shields.io/pypi/v/digging)](https://pypi.org/project/digging/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/digging)](https://pypi.org/project/digging/)\n[![codecov](https://img.shields.io/codecov/c/github/opendilab/digging)](https://app.codecov.io/gh/opendilab/digging)\n![Loc](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/RobinC94/7f38f27fb3b34d4bf4d2dbcfcc73d981/raw/loc.json)\n![Comments](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/RobinC94/7f38f27fb3b34d4bf4d2dbcfcc73d981/raw/comments.json)\n\n![GitHub Org's stars](https://img.shields.io/github/stars/opendilab)\n[![GitHub stars](https://img.shields.io/github/stars/opendilab/digging)](https://github.com/opendilan/digging/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/opendilab/digging)](https://github.com/opendilab/digging/network)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/m/opendilab/digging)\n[![GitHub license](https://img.shields.io/github/license/opendilab/digging)](https://github.com/opendilab/digging/blob/master/LICENSE)\n\nDIgging -- Decision Intelligence for digging better parameters in target function/environments.\n\n## Introduction\n\n**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.\n\n**DIgging** is a fundamental platform under [**OpenDILab**](http://opendilab.org/) and it uses [**DI-engine**](https://github.com/opendilab/DI-engine) to build RL searching pipelines.\n\n[Documentation](https://opendilab.github.io/DIgging/main/index.html)\n\n## Outlines\n\n- [DIgging](#digging)\n  - [Introduction](#introduction)\n  - [Outlines](#outlines)\n  - [Installation](#installation)\n  - [Quick start](#quick-start)\n  - [Digging Method Zoo](#digging-method-zoo)\n  - [License](#license)\n\n## Installation\n\nYou can simply install DIgging with `pip` command line from the official PyPI site.\n\n```bash\npip install --user digging\npython -c 'import digging'\n```\n\nOr you can simply install it from the source code.\n\n```bash\ngit clone git clone https://github.com/opendilab/DIgging.git\ncd DIgging\npip install --user .\npython -c 'import digging'\n```\n\nIt will automatically install **DI-engine** together with its requirement packages i.e. **PyTorch**.\n\n## Quick start\n\n**DIgging** defines core algorithm and searching methods as `Digger`. You can define a `Digger` with a searching `Space`,\nand can be modified by a config dict.\n**DIgging** provides two kinds of searching pipeline for a target function. Thet are listed as follow.\n\n1. Interactive Procedure\n\nIt is done by calling `Digger`'s `propose` and `update_score` method, in which you can flexibly define the searching\nprocedures. You can call the `provide_best` method at any time to see the currently best candidate sample and its score.\nHere's an simple example:\n\n```python\ndef target_func(x):\n    ...\n\treturn score\n\nspace = YourSpace(shape=(...))\ndigger = YourDigger(config, space)\n\nfor i in range(max_iterations):\n    samples = digger.propose(sample_num)\n    scores = [target_func(x) for x in samples]\n    digger.update_score(samples, scores)\n\nprint(digger.provide_best())\n```\n\n2. Functional Procedure\n\nIt is done by calling the `search` method of `Digger`, with target function provided as input. The digger will\nautomatically search the best samples of the target according to the config. Here's an example:\n\n```python\ndef target_func(x):\n    ...\n    return score\n\nspace = YourSpace(shape=(...))\ndigger = YourDigger(config, space)\n\ndigger.search(target_func)\n\nprint(digger.provide_best())\n```\n\n3. Reinforcement Learning Procedure\n\nWhen using a Reinforcement Learning `Digger`, users need to provide an RL `Policy` defined in **DI-engine** form,\nand some other RL workers in **DI-engine** such as `Collector`, `Learner`, `ReplayBuffer` are supposed to be used\nin the `Digger`. In the searching procedure, a target `Env` is used instead of a function. So we suggest to use\nthe `search` method to if the user is not familiar with the RL pipeline of **DI-engine**. Here's an example.\n\n```python\ndef target_func(x):\n    ...\n    return score\n\nrl_config = EasyDict(dict(...))\nspace = YourSearchSpace(shape=(...))\npolicy = YourPolicy(rl_config.policy, ...)\ndigger = RLDigger(rl_cfg, space, policy)\n\ndigger.search(target_func)\n\nprint(digger.provide_best())\n```\n\n## Digging Method Zoo\n\n- Genetic Algorithm\n- Bayesian Optimization\n- RL\n\n## Join and Contribute\nWe appreciate all contributions to improve DIgging, both algorithms and system designs. Welcome to OpenDILab community! Scan the QR code and add us on Wechat:\n\u003cdiv align=center\u003e\u003cimg width=\"250\" height=\"250\" src=\"./docs/figs/qr.png\" alt=\"qr\"/\u003e\u003c/div\u003e\n\nOr you can contact us with [slack](https://opendilab.slack.com/join/shared_invite/zt-v9tmv4fp-nUBAQEH1_Kuyu_q4plBssQ#/shared-invite/email) or email (opendilab@pjlab.org.cn).\n\n## License\n\n**DIgging** is released under the Apache 2.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopendilab%2Fdigging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopendilab%2Fdigging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopendilab%2Fdigging/lists"}