MCPcopy Create free account
hub / github.com/bamler-lab/constriction / run_encoder_part

Function run_encoder_part

tests/python/test_docexamples.py:125–136  ·  view source on GitHub ↗
(side_information)

Source from the content-addressed store, hash-verified

123 stds = np.array([6.4, 4.2, 3.9])
124
125 def run_encoder_part(side_information):
126 # Construct a `ChainCoder` for *decoding*:
127 coder = constriction.stream.chain.ChainCoder(
128 side_information, # Provided bit string.
129 is_remainders=False, # Bit string is *not* remaining data after decoding.
130 seal=True # Bit string comes from an external source here.
131 )
132 # Decode side information into a sequence of symbols as usual in bits-back coding:
133 symbols = coder.decode(leaky_gaussian, means, stds)
134 # Obtain what's *remaining* on the coder after decoding the symbols:
135 remaining1, remaining2 = coder.get_remainders()
136 return symbols, np.concatenate([remaining1, remaining2])
137
138 def run_decoder_part(symbols, remaining):
139 # Construct a `ChainCoder` for *encoding*:

Callers 1

test_chain1Function · 0.70

Calls 2

decodeMethod · 0.95
get_remaindersMethod · 0.95

Tested by

no test coverage detected