-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance Optimizations throughouth the codebase (#68)
* Minimally faster projection matrix * Minimally faster prior computation * Remove an old unused line of code * Fix a wrong check; diffusions are now faster for the EK0 * Specify matrices instead of letting it compute zero matmuls * Pass the diffusion as type, not as symbol * Separate the `copy`s and `similar`s from the cache creation * Hard-code `X_A_Xt` for diagonal X'es * Make `A` a full matrix since Octavian is that much faster * Use floats in `_matmul!(C, A, B, a, b)` * Reduce allocations in `estimate_diffusion(DynamicDiffusion)` * Optimize the `update!` step some more * More usage of `_matmul!` * Use Octavian.jl's matmul! for a wider range of matrices and vectors * Move the diffusion back to being specified with a symbol * Remove the fixedMAP diffusion from the tests * Fix `update!` for the EK0 * Remove the `OctavianCompatibleMatrices` type * Fix the usage of `update!` in the RungeKuttaInit() * Fix the allocating convenience `update!` function * Fix some filtering tests that passed LowerTriangular matrices * Update the benchmark.ipynb * Fix an issue by using mul! instead of matmul! I'm really not sure what goes wrong there, but this seems to fix it... * Make the prior more stable again, using the elType that is supplied * Update the benchmark once more
- Loading branch information
1 parent
803ec17
commit 535e52c
Showing
14 changed files
with
1,765 additions
and
1,743 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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 |
---|---|---|
@@ -1,4 +1,14 @@ | ||
function projection(d, q, elType=typeof(1.0)) | ||
Proj(deriv) = kron(diagm(0 => ones(elType, d)), [i==(deriv+1) ? 1 : 0 for i in 1:q+1]') | ||
function projection(d::Integer, q::Integer, elType=typeof(1.0)) | ||
# Proj(deriv) = kron(diagm(0 => ones(elType, d)), [i==(deriv+1) ? 1 : 0 for i in 1:q+1]') | ||
|
||
# Slightly faster version of the above: | ||
D = d*(q+1) | ||
Proj(deriv) = begin | ||
P = zeros(elType, d, D) | ||
@simd ivdep for i in deriv*d + 1 : D+1 : d*D | ||
@inbounds P[i] = 1 | ||
end | ||
return P | ||
end | ||
return Proj | ||
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
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
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