mean-conc-beta
Beta distribution parameterized by mean and concentration for bounded continuous action spaces in reinforcement learning.
Install
$ pip install mean-conc-beta
Usage
import torch
import torch.nn.functional as F
from mean_conc_beta import Beta
beta = Beta()
# network output: (batch, num_actions, 2) for raw mean and concentration
params = torch.randn(16, 4, 2, requires_grad = True)
# distribution on (-1, 1)
dist = beta(params)
# sample actions
actions = dist.sample()
actions_reparam = dist.rsample()
# log prob and entropy
log_prob = beta.log_prob(dist, actions)
entropy = beta.entropy(dist)
# behavior cloning with mse loss on mean
expert_actions = torch.rand(16, 4)
pred_mean = beta.mean(params)
bc_loss = F.mse_loss(pred_mean, expert_actions)
bc_loss.backward()
Citations
@article{Ferrari2004BetaRF,
title = {Beta Regression for Modelling Rates and Proportions},
author = {Silvia L. P. Ferrari and Francisco Cribari-Neto},
journal = {Journal of Applied Statistics},
year = {2004},
volume = {31},
pages = {799 - 815}
}
@inproceedings{Chou2017TheBP,
title = {The Beta Policy for Continuous Reinforcement Learning},
author = {Po-Wei Chou and Daniel Maturana and Sebastian Scherer},
booktitle = {International Conference on Machine Learning},
year = {2017}
}
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mean_conc_beta-0.0.1.tar.gz
(5.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mean_conc_beta-0.0.1.tar.gz.
File metadata
- Download URL: mean_conc_beta-0.0.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b633f3185a7ad27e623844f298faf4767c199d9685cf418ed78d46aa7e5f5540
|
|
| MD5 |
751f6aa9e2d56842a46a5b7e6805c92a
|
|
| BLAKE2b-256 |
6294e85d1c792f3fa0a08f3d9cce94dfd47515c3ad150314b56ae09d359faa5f
|
File details
Details for the file mean_conc_beta-0.0.1-py3-none-any.whl.
File metadata
- Download URL: mean_conc_beta-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
befeea1135dc19ded04f22d40196c304054e6534afda556f7d50deadc91dadc0
|
|
| MD5 |
0643f6ebc7dd8ff2b414d2f83c70ec96
|
|
| BLAKE2b-256 |
a1cc290d8cb3f4cc5c0408c54f55fe8df80851b04f66e8050517e1e96a7005a4
|