Closed kahaaga closed 1 year ago
Returning only the leftmost edge seems to me the way to go. It would be more expensive to return both edges.
We don't have to consider this breaking change. I consider this a bugfix actually.
and yes, using rectangular bin encoding internally also seems like th way to go. reduce code duplication, increase code re-use = best software
We don't have to consider this breaking change. I consider this a bugfix actually.
Yes, good point.
and yes, using rectangular bin encoding internally also seems like th way to go. reduce code duplication, increase code re-use = best software
Agreed.
Returning only the leftmost edge seems to me the way to go. It would be more expensive to return both edges.
Ok, then I'll modify GaussianCDFEncoding
to return only the left bin edge in #299.
While working on #299, I realized that there's an inconsistency in what is returned from
decode
.When
decode
-ing an integer symbols
, bothGaussianCDFEncoding
andRectangularBinEncoding
return a representation some subinterval of some interval[a, b]
. WithRectangularBinEncoding
(also true for both of the new encodings in #299), the leftmost edge of the bin represents the entire bin. WithGaussianCDFEncoding
, however, both edges of the bin is returned. I think we should be consistent and return only the leftmost edge, or both bin edges.Any of the two alternatives above would be a breaking change, since the return value changes. What do you think, @Datseris?
We can also just keep it as is, but this became relevant because I wanted to use
RectangularBinEncoding
internally forGaussianCDFEncoding
and dispatch todecode(::RectangularBinEncoding, s::Int)
instead of doing the decoding step manually. This is also what happens for the two new encodings, so it is a bit weird thatGaussianCDFEncoding
is doing it manually.