Skip to content

Conversation

@henryrobbins
Copy link
Owner

The current implementation of _continuous, $x/k$ maps 0 to 0 and k to 1 which
feels desirable. However, I beleive _discretize should be the inverse of
_continuous which results in the current implementation of _discretize being
$ceil(x*k - 0.5)$ which has "bins" of differing widths at the extremes (half
the width of the internal bins). This does not feel right. The TODO notes
describe a counter-proposal in which _discretize maps to constant-width bins
but the inverse means that _continuous no longer maps 0 and k to 0 and 1
respectivley. This also feels wrong.

The current implementation of _continuous, $x/k$ maps 0 to 0 and k to 1 which
feels desirable. However, I beleive _discretize should be the inverse of
_continuous which results in the current implementation of _discretize being
$ceil(x*k - 0.5)$ which has "bins" of differing widths at the extremes (half
the width of the internal bins). This does not feel right. The TODO notes
describe a counter-proposal in which _discretize maps to constant-width bins
but the inverse means that _continuous no longer maps 0 and k to 0 and 1
respectivley. This also feels wrong.
@codecov
Copy link

codecov bot commented Aug 13, 2022

Codecov Report

Merging #2 (351691f) into master (d130cf6) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master       #2   +/-   ##
=======================================
  Coverage   92.70%   92.70%           
=======================================
  Files          13       13           
  Lines         713      713           
=======================================
  Hits          661      661           
  Misses         52       52           
Impacted Files Coverage Δ
dmtools/io.py 97.61% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@henryrobbins henryrobbins changed the title Added TODO with potential change to _continuous and _discretize. Image quantization Aug 13, 2022
@henryrobbins
Copy link
Owner Author

@dtorop This has been bothering me for awhile. Any thoughts? I had trouble finding the "right way" to do this because I didn't know which keywords to search for.

@henryrobbins henryrobbins changed the title Image quantization Image Quantization Aug 13, 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.

2 participants