Incorporating significant changes by @dsevero:
-
Adaptive codecs
Signatures of push and pop are extended to allow for a *context variable.push: (ans_state, symbol, *context) -> (ans_state, *context) pop: (ans_state, *context) -> (ans_state, symbol, *context)
Note that, since context is passed via unpacking (i.e. *context), then it is essentially optional. Therefore, previous codecs are still compliant with this new signature.
However, the return of push will be at least (ans_state,), so function calls have been adapted accordingly. This means that instead of
message = codec.push(message, symbol)
we now have
message, = codec.push(message, symbol)
-
Multiset codec
The multiset codec from https://github.com/facebookresearch/multiset-compression was ported to craystack/codecs/multiset.py. -
Extra example
An extra example, showing how to use the multiset codec for BMNIST with BB-ANS, was added to craystack/examples.