Model documents and description length

Model documents and description length#

A System and its parameters can be written as a versioned JSON document, with an arrays file beside it, and built back from that document. The same description is what description length is measured on. Replaying a recorded trace is described under Logging and replay.

The model as a document#

describe

The document for (system, params), plus its arrays file.

build

The (System, SystemParams) a document describes.

schema

JSON Schema (2020-12) for the document: keys, types, the clamp forms (a value, exactly one of ref or init, or a tree of clamps), the role labels' time rules, the bracket form of a parent and the term record.

Description

What describe() returns: the JSON document and its arrays file.

DescriptionError

A document that does not describe a System, with the address and the repair.

describe_parameters

The parameter envelope of a document: one record per static variable's array, read off the document's own records without constructing the model.

ParameterRecord

One parameter array a document declares.

register_transition

Register cls, the class of a NonlinearGaussianTransition's f, under name, so that describe() writes such an f as its name and its fields and build() rebuilds it.

registered_transitions

The registered transition functions, {name: class}, in registration order.

save

Write <path>.json and, when there are refs, <path>.npz beside it.

load

Read a document written by save(), with its arrays file if it names one.

check_observation_support

Check that every level of every tabular modality is produced by some state.

check_joint_support

The observation tuples no state configuration explains: exhaustive, within a budget.

Description length#

DescriptionLength

A model's length, or a model's and a trace's together, in nats.