Skip to content

v0.2: Extend Craystack API allowing adaptive codecs, add Multiset codec, an…

Latest
Compare
Choose a tag to compare
@j-towns j-towns released this 11 Aug 15:07
· 6 commits to master since this release
98f5803

Incorporating significant changes by @dsevero:

  1. 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)
    
  2. Multiset codec
    The multiset codec from https://github.com/facebookresearch/multiset-compression was ported to craystack/codecs/multiset.py.

  3. Extra example
    An extra example, showing how to use the multiset codec for BMNIST with BB-ANS, was added to craystack/examples.