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

Function run_decoder_part

tests/python/test_docexamples.py:138–149  ·  view source on GitHub ↗
(symbols, remaining)

Source from the content-addressed store, hash-verified

136 return symbols, np.concatenate([remaining1, remaining2])
137
138 def run_decoder_part(symbols, remaining):
139 # Construct a `ChainCoder` for *encoding*:
140 coder = constriction.stream.chain.ChainCoder(
141 remaining, # Provided bit string.
142 is_remainders=True, # Bit string *is* remaining data after decoding.
143 seal=False # Bit string comes from a `ChainCoder`, no need to seal it.
144 )
145 # Re-encode the symbols to recover the side information:
146 coder.encode_reverse(symbols, leaky_gaussian, means, stds)
147 # Obtain the reconstructed data
148 data1, data2 = coder.get_data(unseal=True)
149 return np.concatenate([data1, data2])
150
151 np.random.seed(123)
152 sample_side_information = np.random.randint(2**32, size=10, dtype=np.uint32)

Callers 1

test_chain1Function · 0.70

Calls 2

encode_reverseMethod · 0.95
get_dataMethod · 0.95

Tested by

no test coverage detected