Skip to content

Commit

Permalink
added more tests to CI matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyingWorkshop committed Apr 1, 2024
1 parent 237faf6 commit 581c20e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
- '1.10'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
steps:
Expand Down
3 changes: 3 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ pkg> add CompressedBeliefMDPs
Using belief compression is easy. Simplify pick a `Sampler`, `Compressor`, and a base `Policy` and then use the standard POMDPs.jl interface.

```julia
using POMDPs, POMDPTools, POMDPModels
using CompressedBeliefMDPs

pomdp = BabyPOMDP()
compressor = PCACompressor(1)
updater = DiscreteUpdater(pomdp)
Expand Down
2 changes: 1 addition & 1 deletion src/cbmdp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ POMDPs.discount(m::CompressedBeliefMDP) = discount(m.bmdp)
POMDPs.convert_s(t::Type, s, m::CompressedBeliefMDP) = convert_s(t, s, m.bmdp.pomdp)
POMDPs.convert_s(t::Type{<:AbstractArray}, s::AbstractArray, m::CompressedBeliefMDP) = convert_s(t, s, m.bmdp.pomdp) # NOTE: this second implementation is b/c to get around a requirement from POMDPLinter

# TODO: maybe exclude include sparsecat
# TODO: maybe exclude include sparsecat; e.g., for sparsecat do [pdf(s, x) for x in support(s)]
ExplicitDistribution = Union{SparseCat, BoolDistribution, Deterministic, Uniform} # distributions w/ explicit PDFs from POMDPs.jl (https://juliapomdp.github.io/POMDPs.jl/latest/POMDPTools/distributions/#Implemented-Distributions)
POMDPs.convert_s(::Type{<:AbstractArray}, s::ExplicitDistribution, m::POMDP) = [pdf(s, x) for x in states(m)]
POMDPs.convert_s(::Type{V}, s::DiscreteBelief, p::POMDP) where V<:AbstractArray = s.b
Expand Down
6 changes: 3 additions & 3 deletions test/compressor_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FLUX_COMPRESSORS = (

@testset "Compressor Tests" begin
pomdp = BabyPOMDP()
sampler = PolicySampler(pomdp; n=50)
sampler = BeliefExpansionSampler(pomdp; n=5)
@testset "MultivariateStats Compressors" begin
@testset "$C" for C in MVS_COMPRESSORS
@test_nowarn test_compressor(pomdp, sampler, C(1))
Expand All @@ -34,8 +34,8 @@ FLUX_COMPRESSORS = (
end
@testset "ManifoldLearning Compressors" begin
@testset "$C" for C in MANIFOLD_COMPRESSORS
@test_nowarn test_compressor(pomdp, sampler, C(1; k=15))
@test_nowarn test_compressor(pomdp, sampler, C(2; k=15))
@test_nowarn test_compressor(pomdp, sampler, C(1; k=5))
@test_nowarn test_compressor(pomdp, sampler, C(2; k=5))
end
end
@testset "Flux Compressors" begin
Expand Down

0 comments on commit 581c20e

Please sign in to comment.