Bitwiseness#14
Open
turtle261 wants to merge 9 commits into
Open
Conversation
Much is still to be done and this isn't final
- Fix issue leftover in benchmark code that used out of date zpaq usage after a parallelization logic change - Add BinaryToken (bitwise) support natively - Make the `Ctw` model AC-CTW, and leave `FacCtw` as FAC-CTW, instead of `Ctw` being a wrapper over FacCtw, and removing convoluted AIXI logic around this. - Macroize RateBackend capabilities/runtime - For Byte models operating bitwise, add a binary tree to allow O(1) MSB and LSB lookup per-bit. - We have `BinaryTokens` - a true binary representation, for which native bit models work, and 2-symbol [0,1] byte model usage. Added `BytePrefix` as a session type, which uses the binary tree to decompose and provide per-bit probabilities. The former ensures per-bit learning, whereas the latter updates only per byte.
- Prevents RateBackendBitSession::finish() from rejecting cleanly-aligned streams by evaluating BytePrefixMass::has_partial_bits instead of failing if the prediction cache merely exists.
This introduces `supports_frozen_reset` and `begin_fresh_stream` to the `OnlineBytePredictor` trait, allowing backends like ZPAQ to gracefully signal their inability to perform in-place plugin state resets without violating the API semantic contract.
…tationarity in semantics; Also fix some outdated logic in scripts.
…provements - Add bindings for new bitwise helpers: - Expose BitOrder, BitStreamSemantics, BinaryPrediction, BytePrefixMass, and RateBackendBitSession - Add InfotheoryCtx.rate_backend_bit_session and string alias parsing for bit semantics/order - Add python tests for said new bitwise python code - In Infotheory, Add BytePrefixMass::from_log_probs - Route RateBackendBitSession prefix initialization through the shared helper
- Add `begin_stream` hooks to `RateBackendSession` and `RateBackendBitSession` - Update `MixtureRuntime` to route restarts via `begin_fresh_stream`. Mixture weights and cumulative log losses correctly reset to their priors, while delegating to each expert's supported initialization behavior (preserving fitted state on resettable experts while hard-restarting non-resettable ones). - Harden the ZPAQ memory lifecycle by guaranteeing a sequential `drop(take())` of the underlying streaming context prior to reallocation. - Update tests accordingly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make bitwise predictor and consumer support first-class, including bit-to-byte and byte-to-bit adaptability and interoperability.
This involves several layers:
Ctw-- which was previously AC-CTW in AIXI paths, but FAC-CTW in compression -- it's now just AC-CTW consistently, withFacCtwbeing the unambigous FAC-CTW path.This should open up the way to implement Secondary Symbol Estimation, and some more useful algorithms which wouldn't otherwise be fit for a bytewise prediction library.