Skip to content

add ROF ADMM solver#238

Draft
johnnychen94 wants to merge 2 commits intomasterfrom
jc/rof
Draft

add ROF ADMM solver#238
johnnychen94 wants to merge 2 commits intomasterfrom
jc/rof

Conversation

@johnnychen94
Copy link
Copy Markdown
Member

@johnnychen94 johnnychen94 commented Nov 6, 2021

This is currently incomplete, the benchmark shows that it's already faster than the MATLAB equivalent version. Yet I think we still have more room for optimization wrt the FFT-related operations, so I opened this draft to see if there are any suggestions on this.

using ImageFiltering, ImageCore, TestImages, ImageShow
using ImageFiltering.Models

img = Float32.(testimage("cameraman"))
noisy_img = img .+ 0.25 .* randn(size(img))

@btime solve_ROF_ADMM($noisy_img, 0.25, 0.02; num_iters=100);
# julia + FFTW v1.1.1: 856.001 ms (104403 allocations: 639.15 MiB)
# julia + FFTW v1.4.5: 1.275 s (8316 allocations: 632.49 MiB)
# matlab: 1.851779s

FFTW has some performance regression here: JuliaMath/FFTW.jl#224

Comment on lines +269 to +271
# TODO(johnnychen94): optimize the memory allocation
fft_tmp .= μ .* fft(RHS)./LHS
u .= real.(ifft(fft_tmp))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the performance hot spot:

preview.png

I guess we can use in-place version fft! or real version rfft to boost it.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 6, 2021

Codecov Report

❌ Patch coverage is 0% with 50 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.42%. Comparing base (424523c) to head (68cbe6d).
⚠️ Report is 36 commits behind head on master.

Files with missing lines Patch % Lines
src/models.jl 0.00% 50 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #238      +/-   ##
==========================================
- Coverage   91.86%   89.42%   -2.45%     
==========================================
  Files          12       12              
  Lines        1647     1692      +45     
==========================================
  Hits         1513     1513              
- Misses        134      179      +45     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant