Backend-neutral amortized conditional sampling for declared simulator tasks. An artifact samples an APPROXIMATE posterior; no likelihood, importance correction or causal interpretation is inferred from its training loss. Numeric schemas and result measures are portable. Training backends are optional.
Backend-neutral amortized conditional sampling for declared simulator tasks. An artifact samples an APPROXIMATE posterior; no likelihood, importance correction or causal interpretation is inferred from its training loss. Numeric schemas and result measures are portable. Training backends are optional.
(abduct artifact posterior evidence & [{:keys [seed] :or {seed 1}}])Reconstruct causal noise from learned draws using an explicit task adapter. Adapter gets (target-map evidence). No causal semantics follows from a learned conditional alone; it must reconstruct all noise required by replay.
Reconstruct causal noise from learned draws using an explicit task adapter. Adapter gets (target-map evidence). No causal semantics follows from a learned conditional alone; it must reconstruct all noise required by replay.
(artifact task backend payload & [validation])Bind a task to a backend payload. Backend :sample returns a spin yielding n full encoded rows; :freeze and :thaw convert payload to/from data. :train returns a spin yielding a payload. These are optional backend APIs; sampling never implies a usable proposal density.
Bind a task to a backend payload. Backend :sample returns a spin yielding n full encoded rows; :freeze and :thaw convert payload to/from data. :train returns a spin yielding a payload. These are optional backend APIs; sampling never implies a usable proposal density.
(condition task evidence)Validate a query against the task's trained masks and encode known values. Returns coordinates plus a per-coordinate observed mask.
Validate a query against the task's trained masks and encode known values. Returns coordinates plus a per-coordinate observed mask.
(decode {:keys [name type shape values bounds width]} coordinates)Decode numeric coordinates. One-hot relaxation uses argmax: an explicitly approximate discrete sampler, not a categorical likelihood.
Decode numeric coordinates. One-hot relaxation uses argmax: an explicitly approximate discrete sampler, not a categorical likelihood.
(description task)Serializable task contract. Encoder code, simulator and causal adapters are rebound by the application when restoring an artifact.
Serializable task contract. Encoder code, simulator and causal adapters are rebound by the application when restoring an artifact.
(encode {:keys [name type shape values bounds encoder]} value)Encode ONE declared variable into numeric coordinates. Positive/interval values use log/logit; simplex uses additive log ratios in its interior; finite values use one-hot coordinates. Embeddings are observation features.
Encode ONE declared variable into numeric coordinates. Positive/interval values use log/logit; simplex uses additive log ratios in its interior; finite values use one-hot coordinates. Embeddings are observation features.
(encode-row task row)Encode one complete simulator row in the declared coordinate order.
Encode one complete simulator row in the declared coordinate order.
(examples task n & [{:keys [seed] :or {seed 1}}])A spin generating n independent prior simulator rows through GFI. Sessions close on success and failure. Observe-site generation must be opted into; factors require an explicit normalized joint-data provider instead.
A spin generating n independent prior simulator rows through GFI. Sessions close on success and failure. Observe-site generation must be opted into; factors require an explicit normalized joint-data provider instead.
(freeze artifact)Portable DATA checkpoint; no compiled closures, encoder code or GPU handles.
Portable DATA checkpoint; no compiled closures, encoder code or GPU handles.
(generative-policy simulate-observed?)Prior simulation without evaluating likelihoods or honoring inference guides. Used only for collecting joint training examples; its ephemeral trace is NOT a scored posterior trace. Observe-site generation remains an explicit opt-in. Model hard interventions are handled by the ordinary trace policy.
Prior simulation without evaluating likelihoods or honoring inference guides. Used only for collecting joint training examples; its ephemeral trace is NOT a scored posterior trace. Observe-site generation remains an explicit opt-in. Model hard interventions are handled by the ordinary trace policy.
(infer artifact
evidence
&
[{:keys [draws seed targets] :or {draws 256 seed 1}}])Return a spin resolving an ApproximateMeasure over target maps. :targets projects samples of the trained joint, without pretending to skip neural computation. Equal weights are not an accuracy certificate; evidence and proposal densities are not estimated. Diagnostics retain this distinction.
Return a spin resolving an ApproximateMeasure over target maps. :targets projects samples of the trained joint, without pretending to skip neural computation. Equal weights are not an accuracy certificate; evidence and proposal densities are not estimated. Diagnostics retain this distinction.
(predictive posterior model-fn n & [{:keys [seed] :or {seed 1}}])A spin generating forward rollouts from learned posterior draws. model-fn receives a target map and returns a simulator spin, explicitly binding the parameters/state used by the rollout. Observations draw fresh; no posterior noise is reused. This supports action evaluation, not retrospective worlds.
A spin generating forward rollouts from learned posterior draws. model-fn receives a target map and returns a simulator spin, explicitly binding the parameters/state used by the rollout. Observations draw fresh; no posterior noise is reused. This supports action evaluation, not retrospective worlds.
(resume fitted options)Continue training a live or thawed artifact. Reuses its simulator count and seed; explicit example banks must be supplied again. The backend checks data identity and restores optimizer state. Previously attached validation is stale after further training and must be performed again.
Continue training a live or thawed artifact. Reuses its simulator count and seed; explicit example banks must be supplied again. The backend checks data identity and restores optimizer state. Previously attached validation is stale after further training and must be performed again.
(task simulator {:keys [id schema conditionings attention-edges] :as options})Declare a zero-argument simulator factory returning a spin with a map result. :schema is an ordered vector of {:name :role :type :shape ...} descriptors. :conditionings declares supported sets of observed names; :input variables are always known. Missing observations remain latent, NOT nonexistent. Optional :project receives (result choices); :abduct receives (draw evidence) and reconstructs a reusable cf abduction. :model is a causal replay factory. :attention-edges are undirected hints between declared names, not causal facts. :simulate-observed? explicitly generates fresh values at observe sites. Factor-scored simulations are refused by the dataset collector.
Declare a zero-argument simulator factory returning a spin with a map result.
:schema is an ordered vector of {:name :role :type :shape ...} descriptors.
:conditionings declares supported sets of observed names; :input variables
are always known. Missing observations remain latent, NOT nonexistent.
Optional :project receives (result choices); :abduct receives (draw evidence)
and reconstructs a reusable cf abduction. :model is a causal replay factory.
:attention-edges are undirected hints between declared names, not causal facts.
:simulate-observed? explicitly generates fresh values at observe sites.
Factor-scored simulations are refused by the dataset collector.(thaw task backend checkpoint)Rebind a checkpoint to its exact task description and backend. Application supplies simulator/encoder/causal callbacks, including their version IDs.
Rebind a checkpoint to its exact task description and backend. Application supplies simulator/encoder/causal callbacks, including their version IDs.
(train task
backend
{:keys [examples simulations seed validation-examples
validation-simulations posterior-validator]
:or {simulations 4096 seed 1 validation-simulations 128}
:as options})Train on generated or explicitly supplied JOINT examples, then bind an artifact. Backend options pass through. :simulations defaults to 4096. The backend may reuse these finite rows across optimizer updates.
Train on generated or explicitly supplied JOINT examples, then bind an artifact. Backend options pass through. :simulations defaults to 4096. The backend may reuse these finite rows across optimizer updates.
(validate fitted validator)Run an application-defined posterior validator (artifact -> spin/report). It must return {:scope :posterior :passed? boolean ...}. Passing applies only to the checks declared by that validator, not every possible observation.
Run an application-defined posterior validator (artifact -> spin/report).
It must return {:scope :posterior :passed? boolean ...}. Passing applies only
to the checks declared by that validator, not every possible observation.(worlds artifact posterior evidence specs)A spin replaying declared causal worlds using approximate abductions.
A spin replaying declared causal worlds using approximate abductions.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |