(symbols, remaining)
| 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) |
no test coverage detected