-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prune Changes #19
Open
dylan-asmar
wants to merge
9
commits into
main
Choose a base branch
from
prune_changes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Prune Changes #19
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3d697fc
Added pruning of alpha vectors for strictly dominated vectors at each…
dylan-asmar 17df213
Chnage to not update Gamma size
dylan-asmar 10c99ec
Update to `prune_alpha!`
dylan-asmar ff3e8cc
function name update
dylan-asmar c94bdf7
formatting update
dylan-asmar 03a751e
Added tests for prune functions
dylan-asmar 4794b0e
Update src/prune.jl
dylan-asmar edbe960
Update src/prune.jl
dylan-asmar 67133d0
Updated `prune_strictly_dominated!` to reduce allocations
dylan-asmar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@testset "prune" begin | ||
# NativeSARSOP.strictly_dominates | ||
a1 = [1.0, 2.0, 3.0] | ||
a2 = [1.0, 2.1, 2.9] | ||
a3 = [0.9, 1.9, 2.9] | ||
@test !NativeSARSOP.strictly_dominates(a1, a2, 1e-10) | ||
@test NativeSARSOP.strictly_dominates(a1, a1, 1e-10) | ||
@test NativeSARSOP.strictly_dominates(a1, a3, 1e-10) | ||
|
||
# NativeSARSOP.intersection_distance | ||
b = SparseVector([1.0, 0.0]) | ||
a1 = [1.0, 0.0] | ||
a2 = [0.0, 1.0] | ||
@test isapprox(NativeSARSOP.intersection_distance(a1, a2, b), | ||
sqrt(0.5^2 + 0.5^2), atol=1e-10) | ||
|
||
b = SparseVector([0.5, 0.5]) | ||
@test isapprox(NativeSARSOP.intersection_distance(a1, a2, b), 0.0, atol=1e-10) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pruning strictly dominated alpha vecs at every iteration seems to take up a lot of time. Have you found performance to be worse when lumping it together with the conditional block containing
prune_alpha!
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do remember considering this, but I don't remember the details when I compared the two. I can run some comparisons and report back. (timeline TBD)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TL;DR; I'd recommend keeping it as pruning at every iteration.
Just ran the comparison for
delta=1e-4
. The allocations are a bit higher when running at every iteration, but the overall process is faster. The difference between these benchmarks and the original ones posted at the submission of the PR is due to the suggested changes (which help out quite a bit!).BabyPOMDP
Settings:
Benchmark
At Every Iteration
Only when
should_prune_alphas
Policy Run
At Every Iteration
Only when
should_prune_alphas
TigerPOMDP
Settings:
Benchmark
At Every Iteration
Only when
should_prune_alphas
Policy Run
At Every Iteration
Only when
should_prune_alphas
RockSamplePOMDP(5,5)
Settings:
Benchmark
At Every Iteration
Only when
should_prune_alphas
Policy Run
At Every Iteration
Only when
should_prune_alphas
TagPOMDP
Settings:
Benchmark
At Every Iteration
Only when
should_prune_alphas
Policy Run
At Every Iteration
Only when
should_prune_alphas
TagPOMDP
Settings:
Policy Run
At Every Iteration
Only when
should_prune_alphas
RockSamplePOMDP(15,10)
Settings:
Policy Run
At Every Iteration
Only when
should_prune_alphas