Skip to main content

Gradient Boosted Trees for RL

Project description

Gradient Boosting Reinforcement Learning (GBRL)

GBRL is a Python-based Gradient Boosting Trees (GBT) library, similar to popular packages such as XGBoost, CatBoost, but specifically designed and optimized for reinforcement learning (RL). GBRL is implemented in C++/CUDA aimed to seamlessly integrate within popular RL libraries.

License PyPI version

Overview

GBRL adapts the power of Gradient Boosting Trees to the unique challenges of RL environments, including non-stationarity and the absence of predefined targets. The following diagram illustrates how GBRL uses gradient boosting trees in RL:

GBRL Diagram

GBRL features a shared tree-based structure for policy and value functions, significantly reducing memory and computational overhead, enabling it to tackle complex, high-dimensional RL problems.

Key Features:

  • GBT Tailored for RL: GBRL adapts the power of Gradient Boosting Trees to the unique challenges of RL environments, including non-stationarity and the absence of predefined targets.
  • Optimized Actor-Critic Architecture: GBRL features a shared tree-based structure for policy and value functions. This significantly reduces memory and computational overhead, enabling it to tackle complex, high-dimensional RL problems.
  • Hardware Acceleration: GBRL leverages CUDA for hardware-accelerated computation, ensuring efficiency and speed.
  • Seamless Integration: GBRL is designed for easy integration with popular RL libraries. We implemented GBT-based actor-critic algorithm implementations (A2C, PPO, and AWR) in stable_baselines3 GBRL_SB3.

Performance

The following results, obtained using the GBRL_SB3 repository, demonstrate the performance of PPO with GBRL compared to neural-networks across various scenarios and environments:

PPO GBRL results in stable_baselines3

Getting started

Dependencies

  • Python 3.9 or higher

Installation

GBRL provides pre-compiled binaries for easy installation. Choose one of the following options:

CPU-only installation (default):
pip install gbrl

GPU-enabled installation (requires CUDA 12 runtime libraries):
pip install gbrl-gpu

For further installation details and dependencies see the documentation.

Usage Example

For a detailed usage example, see tutorial.ipynb

Current Supported Features

Tree Fitting

  • Greedy (Depth-wise) tree building - (CPU/GPU)
  • Oblivious (Symmetric) tree building - (CPU/GPU)
  • L2 split score - (CPU/GPU)
  • Cosine split score - (CPU/GPU)
  • Uniform based candidate generation - (CPU/GPU)
  • Quantile based candidate generation - (CPU/GPU)
  • Supervised learning fitting / Multi-iteration fitting - (CPU/GPU)
    • MultiRMSE loss (only)
  • Categorical inputs
  • Input feature weights - (CPU/GPU)

GBT Inference

  • SGD optimizer - (CPU/GPU)
  • ADAM optimizer - (CPU only)
  • Control Variates (gradient variance reduction technique) - (CPU only)
  • Shared Tree for policy and value function - (CPU/GPU)
  • Linear and constant learning rate scheduler - (CPU/GPU only constant)
  • Support for up to two different optimizers (e.g, policy/value) - **(CPU/GPU if both are SGD)
  • SHAP value calculation

Documentation

For comprehensive documentation, visit the GBRL documentation.

Citation

@article{gbrl,
  title={Gradient Boosting Reinforcement Learning},
  author={Benjamin Fuhrer, Chen Tessler, Gal Dalal},
  year={2024},
  eprint={2407.08250},
  archivePrefix={arXiv},
  primaryClass={cs.LG},
  url={https://arxiv.org/abs/2407.08250}, 
}

Licenses

Copyright © 2024, NVIDIA Corporation. All rights reserved.

This work is made available under the NVIDIA Source Code License-NC. Click here. to view a copy of this license.

Project details


Download files

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

Source Distribution

gbrl_gpu-1.1.0.tar.gz (115.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gbrl_gpu-1.1.0-cp312-cp312-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.12Windows x86-64

gbrl_gpu-1.1.0-cp312-cp312-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

gbrl_gpu-1.1.0-cp311-cp311-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.11Windows x86-64

gbrl_gpu-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

gbrl_gpu-1.1.0-cp310-cp310-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.10Windows x86-64

gbrl_gpu-1.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

gbrl_gpu-1.1.0-cp39-cp39-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.9Windows x86-64

gbrl_gpu-1.1.0-cp39-cp39-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

File details

Details for the file gbrl_gpu-1.1.0.tar.gz.

File metadata

  • Download URL: gbrl_gpu-1.1.0.tar.gz
  • Upload date:
  • Size: 115.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for gbrl_gpu-1.1.0.tar.gz
Algorithm Hash digest
SHA256 341a7561a8cec824c9e2fd3cd31674929bd8f27700ae824d21c94214c33264dd
MD5 7609919fa04c857580dc5f138f4c5e43
BLAKE2b-256 8dc593c0ec1331e5d4a2eff3278fcc4781cf5c99b5d23cd5a1ce974b38e37366

See more details on using hashes here.

File details

Details for the file gbrl_gpu-1.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: gbrl_gpu-1.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for gbrl_gpu-1.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ea36ecf69a35811cc220566f7e0b52ef969f050e232f51ef9e96a96c30e63d7d
MD5 a9fa2fa54dee298cae491fdf9182803e
BLAKE2b-256 4e7d68ad47d00dc9734022c67aa01f242f234b53e26b89008d9b9d6f2883654e

See more details on using hashes here.

File details

Details for the file gbrl_gpu-1.1.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gbrl_gpu-1.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 53af687f67d3aa5290941f98e0d4be4e0328de5b51428e3eb91d881d8df4283a
MD5 dc517a16967381fc39b1621ea493682e
BLAKE2b-256 5ae81d79158b0775626c917d2abc1ed64fc5aa4ecd128e478c951ae3b665c85c

See more details on using hashes here.

File details

Details for the file gbrl_gpu-1.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: gbrl_gpu-1.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for gbrl_gpu-1.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 49e9a5d932b73863276d83b9f3adc35e2f59e6de5da2d981fb59ae19c915abda
MD5 328068deabfe10600d1b56accb717eed
BLAKE2b-256 ecda5334f9ae00e0923821ea11215440074c531e55f13498d6f627d68bec2cc0

See more details on using hashes here.

File details

Details for the file gbrl_gpu-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gbrl_gpu-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 19cd272635962b3520934c25b8db058bf2fa03264382d3710cc606825900f15c
MD5 e1f324f0ba1b95f2207c7709034b5f1d
BLAKE2b-256 fdb274e85858e1ade124bdf9adb810e61ed63c43a9a8895620eb60ea444320f4

See more details on using hashes here.

File details

Details for the file gbrl_gpu-1.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: gbrl_gpu-1.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for gbrl_gpu-1.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 15d2294342d1c59855cd07c1b74eedb8c1b69382ac02220e08e880c9b366315f
MD5 0bccd0c4835bf6e6a022eed139863362
BLAKE2b-256 8067464fbb73c2fdee4e296c4ead00db700969a72d4810ce367921335e2df0d5

See more details on using hashes here.

File details

Details for the file gbrl_gpu-1.1.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gbrl_gpu-1.1.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1b394c4cccdba493d01993e227bb9aedfefc60fdb6cdf4b06a8f12c7af6bbc97
MD5 e0e59f20e1f2916cef9e3b2bd92de7ff
BLAKE2b-256 12510b1c9a4eab6b529791a1929daf158f2837d671b65319ddaaca8f4d484943

See more details on using hashes here.

File details

Details for the file gbrl_gpu-1.1.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: gbrl_gpu-1.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for gbrl_gpu-1.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c6fa5e317e1ad0a9ea3eb4f710d886337819fa07a63d0f80abde12f7cd74f148
MD5 8210822c63aa7e2455de62cb371f28a7
BLAKE2b-256 168e4c70800aa5e7ba887cb94c1202027133e49ae9d642f42677b0ff2d99d02c

See more details on using hashes here.

File details

Details for the file gbrl_gpu-1.1.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gbrl_gpu-1.1.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bd554768784fb07441b578f112438fb245bf0ad9e11840686f62ae4fea4cfc5b
MD5 58a29aebcd6b88a5f6fda5057e65232f
BLAKE2b-256 1ce1c38b46c1be0d4b3e07902cef2b2886ae7181d02c26ca17baea0c4271440e

See more details on using hashes here.

Supported by

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