Coherence math primitives for CARL (Coherence-Aware Reinforcement Learning)
Project description
carl-core
Coherence math primitives for CARL — the foundational per-token field that every CARL metric derives from.
Install
pip install carl-core
Use
from carl_core import CoherenceTrace, compute_phi
# From logits:
trace = CoherenceTrace.from_logits(logits, token_ids=tokens, step=0)
print(trace.phi_mean, trace.cloud_quality, trace.carl_reward())
# Raw phi:
phi, probs, entropy = compute_phi(logits)
What's inside
CoherenceTrace— per-token coherence field (phi, entropy, selected_prob, delta_phi)CoherenceProbe/CoherenceSnapshot— probe + snapshot for training-step metricsCoherenceObserver— periodic Claude-backed training health assessmentFrameBuffer/FrameRecord— rolling temporal Phi buffercompute_phi()— order parameter from logits:phi = 1 - H/log|V|- Constants:
KAPPA = 64/3,SIGMA = 3/16,DEFECT_THRESHOLD,T_STAR(d) InteractionChain/Step/ActionType— typed interaction trace
Depends on
numpy, pydantic.
Part of
Carl Studio — Coherence-Aware Reinforcement Learning. Full docs: https://github.com/wheattoast11/carl
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file carl_core-0.1.2.tar.gz.
File metadata
- Download URL: carl_core-0.1.2.tar.gz
- Upload date:
- Size: 192.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c3927e78c2df8c788796504887aaf5de76a481a448872ee3a4f50804f2340eb
|
|
| MD5 |
4242bd1a00a8d9a6ef94c6b69c494fef
|
|
| BLAKE2b-256 |
3ac4facb82a1d2e6abbbb93b488aa4747c2d0d14af2f693fcb8854b82860ca1b
|
Provenance
The following attestation bundles were made for carl_core-0.1.2.tar.gz:
Publisher:
publish.yml on wheattoast11/carl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
carl_core-0.1.2.tar.gz -
Subject digest:
0c3927e78c2df8c788796504887aaf5de76a481a448872ee3a4f50804f2340eb - Sigstore transparency entry: 1377593976
- Sigstore integration time:
-
Permalink:
wheattoast11/carl@3254ab58a4e2278a0513b635d0b9ad21ca562558 -
Branch / Tag:
refs/tags/carl-core@0.1.2 - Owner: https://github.com/wheattoast11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3254ab58a4e2278a0513b635d0b9ad21ca562558 -
Trigger Event:
push
-
Statement type:
File details
Details for the file carl_core-0.1.2-py3-none-any.whl.
File metadata
- Download URL: carl_core-0.1.2-py3-none-any.whl
- Upload date:
- Size: 137.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aca421211650d1ec119057a8e63ba6d697c540c965db069b52793aa37ee36beb
|
|
| MD5 |
2600adea1d04e51b2cfb38eb5b00c05a
|
|
| BLAKE2b-256 |
b8abdb84a1cd9413f3212896e2566ce6e2a6e9fcd0c74edd4de7d6f518e137db
|
Provenance
The following attestation bundles were made for carl_core-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on wheattoast11/carl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
carl_core-0.1.2-py3-none-any.whl -
Subject digest:
aca421211650d1ec119057a8e63ba6d697c540c965db069b52793aa37ee36beb - Sigstore transparency entry: 1377594120
- Sigstore integration time:
-
Permalink:
wheattoast11/carl@3254ab58a4e2278a0513b635d0b9ad21ca562558 -
Branch / Tag:
refs/tags/carl-core@0.1.2 - Owner: https://github.com/wheattoast11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3254ab58a4e2278a0513b635d0b9ad21ca562558 -
Trigger Event:
push
-
Statement type: