Skip to content

Commit

Permalink
changed default compressor
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyingWorkshop committed Mar 27, 2024
1 parent e7dc547 commit 509d0cd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@ add CompressedBeliefMDPs

CompressedBeliefMDPs.jl is compatible with the [POMDPs.jl](https://juliapomdp.github.io/POMDPs.jl/latest/) ecosystem.
```julia
using POMDPs, POMDPModels
using CompressedBeliefMDPs

using POMDPs
using POMDPModels
using POMDPTools

pomdp = TMaze(200, 0.99)
sampler = DiscreteRandomSampler(pomdp)
compressor = PCACompressor(2)
solver = CompressedSolver(pomdp, sampler, compressor)
policy = solve(solver, pomdp)
pomdp = BabyPOMDP()
solver = CompressedBeliefSolver(pomdp)
policy = POMDPs.solve(solver, pomdp)
s = initialstate(pomdp)
v = value(policy, s)
a = action(policy, s)
```

The solver finds an _approximate_ policy for the POMDP.
Expand All @@ -35,12 +33,16 @@ a = action(policy, s)
```
# Sampling

Compression is handled by the `Sampler` abstract type.
There are two ways to collect belief samples: belief expansion or policy rollouts.

## Belief Expansion

CompressedBeliefMDPs.jl implements a fast version of exploratory belief expansion (Algorithm 21.13 from [Algorithms for Decision Making](https://algorithmsbook.com/)) that uses [$k$-d trees](https://en.wikipedia.org/wiki/K-d_tree) from [NearestNeighbors.jl](https://github.com/KristofferC/NearestNeighbors.jl). Belief expansion is supported for POMDPs with finite state, action, and observation spaces.

## Policy Rollouts

# Compression

Compression is handled by the `Compressor` abstract type.

## [MultivariateStats.jl](https://juliapackages.com/p/multivariatestats) Wrappers
# Compressors

As a convenience, we provide several wrappers for compression schemes from MultivariateStats.jl.
As a convenience, we provide several wrappers for compression schemes from [MultivariateStats.jl](https://juliastats.org/MultivariateStats.jl/stable/) and [ManifoldLearning.jl](https://wildart.github.io/ManifoldLearning.jl/stable/).
2 changes: 1 addition & 1 deletion src/solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function CompressedBeliefSolver(
# sampling arguments
explorer::Union{Policy, ExplorationPolicy}=RandomPolicy(pomdp), # explorer policy; only used if expansion is false
updater::Updater=DiscreteUpdater(pomdp), # only works for discrete S
compressor::Compressor=PCACompressor(1),
compressor::Compressor=PCACompressor(2),
expansion=true, # only works for discrete S, A, O
n::Integer=5, # if expansion, then n is the number of times we expand; otherwise, n is max number of belief samples
metric::NearestNeighbors.MinkowskiMetric=Euclidean(),
Expand Down

0 comments on commit 509d0cd

Please sign in to comment.