Skip to content

Commit

Permalink
Change norm to relative norm $\|y_i-D x_i\| / \|y_i\|$
Browse files Browse the repository at this point in the history
  • Loading branch information
RomeoV committed Oct 30, 2024
1 parent 161a2c2 commit bc9ea60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/KSVD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function ksvd(Y::AbstractMatrix{T}, n_atoms::Int;
CH_T = Tuple{Int, Matrix{T}, SparseMatrixCSC{T, Int64}}
trace_channel = Channel{CH_T}(maxiters; spawn=true, taskref=trace_taskref) do ch
for (iter, D, X) in ch
norm_val = norm.(eachcol(Y - D*X)) |> mean
norm_val = (norm.(eachcol(Y - D*X)) ./ norm.(eachcol(Y))) |> mean
nnz_per_col_val = nnz(X) / size(X, 2)
show_trace && @info (iter, norm_val, nnz_per_col_val)
(push!(norm_results, norm_val); push!(nnz_per_col_results, nnz_per_col_val))
Expand Down

0 comments on commit bc9ea60

Please sign in to comment.