quickpomdps - python
quickpomdps is a package to quickly define [PO]MDPs in Python.
You can use any of the solvers in POMDPs.jl ecosystem, directly in Python.
A hybrid continuous-discrete light-dark problem definition and QMDP solution (taken from examples/lightdark.py) looks like this:
r = 60
light_loc = 10
def transition(s, a):
if a == 0:
return Deterministic(r+1)
else:
return Deterministic(min(max(s+a, -r), r))
def observation(s, a, sp):
return Normal(sp, abs(sp - light_loc) + 0.0001)
def reward(s, a, sp):
if a == 0:
return 100.0 if s == 0 else -100.0
else:
return -1.0
m = QuickPOMDP(
states = range(-r, r+2),
actions = [-10, -1, 0, 1, 10],
discount = 0.95,
isterminal = lambda s: s < -r or s > r,
obstype = Float64,
transition = transition,
observation = observation,
reward = reward,
initialstate = Uniform(range(-r//2, r//2+1))
)
solver = QMDPSolver()
policy = solve(solver, m)
Installation
pip install quickpomdps
quickpomdps uses the pyjulia package which requires julia to be installed. We recommend using juliaup for this purpose.
Upon invocation of import quickpomds in Python, all Julia dependencies will be installed if they are not already present.
Please note that, by default, the Julia dependencies are added to the global environment.
If you want to install these dependencies to a local environment instead, export the JULIA_PROJECT with the desired path as documented here.
Development
This package uses python-poetry for dependency management. Thus, it may be installed via one of the may ways supported by poetry, for example,
git clone https://github.com/JuliaPOMDP/quickpomdps
cd quickpomdps
poetry install
poetry run python examples/lightdark.py
Usage
See examples/ and tests/. Documentation can be found at the QuickPOMDPs.jl and POMDPs.jl packages.
Help
If you need help, please ask on the POMDPs.jl discussions page!
Release files for quickpomdps 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| quickpomdps-0.1.2.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| quickpomdps-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.1 kB
Release files / quickpomdps-0.1.2.tar.gz
| Download URL | quickpomdps-0.1.2.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
204955e106d3c21dda99526804aad853a7d395bc365232e0aabc6b06ad3926fd
|
|
BLAKE2b-256 checksum How to use checksums |
14fcb24338a08387989f10490e0cf996baf9efb1a59c2e02dcf3a2ecd04514cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.9.7 Linux/5.15.0-76-generic
|
Release files / quickpomdps-0.1.2-py3-none-any.whl
| Download URL | quickpomdps-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e21102e6d9d2342d5b0419a0a44605d4ea47008ae47925e8fa6cee3801696ea
|
|
BLAKE2b-256 checksum How to use checksums |
35ec30115880142dd92942b403015508a8ac50acc21f1d4ab38f78f13b925bec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.9.7 Linux/5.15.0-76-generic
|