Skip to content

Commit

Permalink
nit: A number of nits in the package.
Browse files Browse the repository at this point in the history
  • Loading branch information
RomeoV committed Dec 16, 2024
1 parent b322421 commit 7b536b5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
8 changes: 3 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name = "KSVD"
uuid = "778123d0-3295-4563-8004-fb5c576fbcd9"
version = "1.8.0"
version = "1.8.1"

[deps]
ChunkSplitters = "ae650224-84b6-46f8-82ea-d812ca08434e"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
Expand All @@ -28,15 +27,14 @@ DistributedArrays = "aaf54ef3-cdf8-58ed-94cc-d582ad619b94"
KSVDCudaExt = "CUDA"

[compat]
ChunkSplitters = "2"
DataStructures = "0.18"
Distributions = "0.22 - 0.25"
OhMyThreads = "0.5"
KrylovKit = "0.8"
OhMyThreads = "0.5 - 0.8"
PrecompileTools = "1"
ProgressMeter = "1"
SparseArrays = "1.9"
StatsBase = "0.30 - 0.35"
KrylovKit = "0.8"
ThreadedDenseSparseMul = "0.4, 0.5"
TimerOutputs = "0.5"
julia = "1.9"
Expand Down
4 changes: 2 additions & 2 deletions src/ksvd_update.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import OhMyThreads
import OhMyThreads: tforeach
# import OhMyThreads: SerialScheduler
import TimerOutputs: TimerOutput, @timeit
import ChunkSplitters: chunks
import OhMyThreads.ChunkSplitters: chunks
import Base.Threads: nthreads, threadpool

# set a default
Expand Down Expand Up @@ -141,7 +141,7 @@ function compute_E_Ω!(::ThreadedKSVDMethodPrecomp{true}, E_Ω_buf, E, Y, D, X,

if size(E_Ω_buf, 2) <= length(ωₖ)
@warn """
The preallocated error buffer is too small. Not all errors will be computed. This is probably because
The preallocated error buffer is too small: $(size(E_Ω_buf, 2)) vs $(length(ωₖ)). Not all errors will be computed. This is probably because
`maybe_init_buffer!` has been called with a ratio_nonzero that's too small. Try setting it to `1`.
"""
ωₖ = ωₖ[1:size(E_Ω_buf, 2)]
Expand Down
2 changes: 1 addition & 1 deletion src/ksvd_update_threaded_utils.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
maybe_init_buffers!(method::KSVDMethod, emb_dim, n_dict_vecs, n_samples, timer=TimerOutput(); pct_nz=1.) = nothing
maybe_init_buffers!(method::KSVDMethod, emb_dim, n_dict_vecs, n_samples, timer=TimerOutput(); ratio_nonzero=1.) = nothing
function maybe_init_buffers!(method::Union{ParallelKSVD{precompute_error, T}, BatchedParallelKSVD{precompute_error, T}},
emb_dim, n_dict_vecs, n_samples, timer=TimerOutput(); ratio_nonzero=1.) where {precompute_error, T<:Real}
@timeit_debug timer "init buffers" begin
Expand Down
2 changes: 1 addition & 1 deletion src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ end
# gen() = sum(sample([0,1], ProbabilityWeights([0.99, 0.01]), 100_000))
# histogram([gen() for _ in 1:1000])
" Compute buffer size that is large enough with extremely high likelyhood."
function compute_reasonable_buffer_size(N, pct_nz; failure_chance = eps())
function compute_reasonable_buffer_size(N, pct_nz; failure_chance = 0)
D = Binomial(N, pct_nz)
quantile(D, 1-failure_chance)
end
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ end
@testset "Run the whole thing" begin
data = rand(100, 500)
ksvd(data, 200)
@test true
end

4 comments on commit 7b536b5

@RomeoV
Copy link
Owner Author

@RomeoV RomeoV commented on 7b536b5 Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/121474

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.8.1 -m "<description of version>" 7b536b5b063796be769f36470e6776e383cab3e1
git push origin v1.8.1

Also, note the warning: Version 1.8.1 skips over 1.7.0
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.

@RomeoV
Copy link
Owner Author

@RomeoV RomeoV commented on 7b536b5 Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/121474

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.8.1 -m "<description of version>" 7b536b5b063796be769f36470e6776e383cab3e1
git push origin v1.8.1

Please sign in to comment.