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.1.tar.gz (121.6 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.1-cp312-cp312-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.12Windows x86-64

gbrl_gpu-1.1.1-cp312-cp312-manylinux_2_31_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

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

Uploaded CPython 3.11Windows x86-64

gbrl_gpu-1.1.1-cp311-cp311-manylinux_2_31_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

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

Uploaded CPython 3.10Windows x86-64

gbrl_gpu-1.1.1-cp310-cp310-manylinux_2_31_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.31+ x86-64

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

Uploaded CPython 3.9Windows x86-64

gbrl_gpu-1.1.1-cp39-cp39-manylinux_2_31_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.31+ x86-64

File details

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

File metadata

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

File hashes

Hashes for gbrl_gpu-1.1.1.tar.gz
Algorithm Hash digest
SHA256 2a60cddbeaaeb558701b57a8b658c4b841c3993df4f031ca9e2870e7f30a6447
MD5 e69336b489bc0bec438733cd49eaa6cf
BLAKE2b-256 675ad1fa5a8843458c9656ba67eec103e1fe3f87621e03d4b1a38bb76cc058fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gbrl_gpu-1.1.1-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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 eec704775d0be6ef31b1428e5d46615db2dc0b89b14d1c88096c1c557d8d69f0
MD5 cecbf25d746e1348f2c8335f07e8919b
BLAKE2b-256 5b568471064642a52e4eecc6a20051cb7531fb718fc9cd339dd6d7848b39e44d

See more details on using hashes here.

File details

Details for the file gbrl_gpu-1.1.1-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gbrl_gpu-1.1.1-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 ad2cab8b239e931cc6202e08cb0c7c410565ef312dd044aeb266c89a5d76e615
MD5 5a86002cff2715e2787253e7110d7b7c
BLAKE2b-256 e705cb272396b78ce7254814eb19194de90c329d77c0be9737b1a634df12c0a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gbrl_gpu-1.1.1-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.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3d8354dac533a1dc8fea87704016204fcf573ca6388e8de07ea140e26fe5e7eb
MD5 54b49dd5e4a2325c33fa4c8e2498c71b
BLAKE2b-256 d3a963dbb6f6e80ca1e341ea9b8a5239364454d3c121831edce1a4c58aa935a8

See more details on using hashes here.

File details

Details for the file gbrl_gpu-1.1.1-cp311-cp311-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gbrl_gpu-1.1.1-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 e8040e6b30344642ec735abf3aaef55e5755e83f0c25b8e3e05df08f1ac0b167
MD5 1197bdddb707ed99ade8f9e4d805af41
BLAKE2b-256 bdc1af39be97c886c7299af8fdd2fb063967ad51c9328e7190d5534647ebcf52

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gbrl_gpu-1.1.1-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.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4dfce43456c14dbdcc0485ba234f0c2eb9f3085f8d22f9c0ee04577399662612
MD5 938b07d33ba09b4946352e17a2332a02
BLAKE2b-256 9edad4c64841573c6eb050f6017e7b49301acb0a1ca58d8fa8f4123c75b74f5c

See more details on using hashes here.

File details

Details for the file gbrl_gpu-1.1.1-cp310-cp310-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gbrl_gpu-1.1.1-cp310-cp310-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 2297080da4c4985c870401e07f9e2ec1229d77bcc75a63cadcd4d6687fb9107d
MD5 59d34ecff22a0f64553227b8c477a637
BLAKE2b-256 552f5091ed21806f0d40981769d0db570962c19556f50ff5cf7f4225804bcb57

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gbrl_gpu-1.1.1-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.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 2d719bb1a5cc5776c963dd9ceca042cde584ea924ef50ce5982a7a50e211dd75
MD5 cca33a4073decd8168869c0dc30c0faf
BLAKE2b-256 7ecd652070809eb9f9e1bc84cb93dfc0bbc728c83a98bed287783ef5a916a1a3

See more details on using hashes here.

File details

Details for the file gbrl_gpu-1.1.1-cp39-cp39-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gbrl_gpu-1.1.1-cp39-cp39-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 22feb0702956cdd16608ec1e4b8937282691777f487aeb6d91acac65d58c42b7
MD5 4cc382e38711a955afbd8416d02f030d
BLAKE2b-256 a608c8540d0bdde1d0633fe5381541ea4794d211c64b076151b3a6bfd6b29784

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