Skip to content
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

Support for quantitative evaluation of deconvolutions and addition of the inital argument to supply start values. #33

Merged
merged 10 commits into from
Jan 28, 2022

Conversation

RainerHeintzmann
Copy link
Contributor

In the analysis_tools.jl support for quantitative evaluation of deconvolutions was added via returning an option structure to be provided to the deconvolution routine. The new function options_trace_deconv returns an opt_options structure to be supplied to deconvolution which then does all the bookkeeping. It also returns a query function that then provides the results.

In addition the "initial" argument was added to allow starting the iterations with a value or array of the user's choice.
The tests of the new functions makes use of this initial argument by supplying the ground truth and checking for the metrics to yield 1.0 and 0.0 respectively.

@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2022

Codecov Report

Merging #33 (21f212f) into master (ede97e0) will decrease coverage by 0.55%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #33      +/-   ##
==========================================
- Coverage   92.71%   92.15%   -0.56%     
==========================================
  Files          14       14              
  Lines         535      599      +64     
==========================================
+ Hits          496      552      +56     
- Misses         39       47       +8     
Impacted Files Coverage Δ
src/lucy_richardson.jl 82.14% <60.00%> (-12.31%) ⬇️
src/generic_invert.jl 88.88% <75.00%> (-1.12%) ⬇️
src/analysis_tools.jl 96.29% <93.75%> (-3.71%) ⬇️
src/deconvolution.jl 97.43% <100.00%> (+0.06%) ⬆️
src/lossfunctions.jl 98.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ede97e0...21f212f. Read the comment docs.

@roflmaostc
Copy link
Owner

Thanks for the PR.

I was wondering, why do we need now iterations=nothing. Why not iterations=20 as before?

Also I would feel more happy if code coverage increases instead of decreasing.

Can you check with CodeCov which are the missing lines and add maybe simplistic tests?

We should ensure that the code is at least running. Checking for meaningful values is hard, I admit.

src/analysis_tools.jl Outdated Show resolved Hide resolved
src/analysis_tools.jl Outdated Show resolved Hide resolved
src/analysis_tools.jl Outdated Show resolved Hide resolved
src/analysis_tools.jl Outdated Show resolved Hide resolved
center_set!(rec0, one_arr)
rec0 .*= mean(measured)
fill!(one_arr, mean(measured))
center_set!(rec0, ones(csize) .* initial)
Copy link
Owner

Choose a reason for hiding this comment

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

Why is ones(csize) needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since I wanted the user to be able to call deconvolution also with a single number (such as the mean or 0.0) for initialization.

Copy link
Owner

Choose a reason for hiding this comment

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

Did you try without ones(csize)?
Maybe center_set! handles that correctly.

src/analysis_tools.jl Outdated Show resolved Hide resolved
src/analysis_tools.jl Outdated Show resolved Hide resolved
src/analysis_tools.jl Outdated Show resolved Hide resolved
src/analysis_tools.jl Outdated Show resolved Hide resolved
end
end
idx += 1
false
Copy link
Owner

Choose a reason for hiding this comment

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

false? Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is specific to the callback. If it returns true the optimizer is told to stop.

Copy link
Owner

Choose a reason for hiding this comment

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

maybe add that as a comment and with an explicit return false

@RainerHeintzmann
Copy link
Contributor Author

RainerHeintzmann commented Jan 12, 2022

Thanks for the PR.

I was wondering, why do we need now iterations=nothing. Why not iterations=20 as before?

Also I would feel more happy if code coverage increases instead of decreasing.

Can you check with CodeCov which are the missing lines and add maybe simplistic tests?

We should ensure that the code is at least running. Checking for meaningful values is hard, I admit.

Before it was a bit inconsistent with the iterations (default 20 for deconvolution and 10 for invert). But the main point is that the default nothing is needed to be able to check if the user supplied an argument and throw an error if an option and the iteration arguments are both supplied. This avoids surprised users that the function seemingly ignores the iteration argument.

@RainerHeintzmann
Copy link
Contributor Author

New commit with hopefully everything fixed. Also the code coverage should have been increased.

@roflmaostc roflmaostc merged commit a6f3c44 into roflmaostc:master Jan 28, 2022
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.

None yet

3 participants