schema.serde.hyperparameters.HyperparametersSerde

Serializes and deserializes a ModelSpec into a Hyperparameters proto.

Inherits From: Serde

Note that this Serde only handles the Hyperparameters part of ModelSpec. The 'prior' attribute of ModelSpec is serialized/deserialized separately using DistributionSerde.

Methods

deserialize

View source

Deserializes the given Hyperparameters proto into a ModelSpec.

Note that this only deserializes the Hyperparameters part of ModelSpec. The 'prior' attribute of ModelSpec is deserialized separately using DistributionSerde and should be combined in the MeridianSerde.

Args
serialized The serialized Hyperparameters proto.
serialized_version The version of the serialized model. This is used to handle changes in deserialization logic across different versions.

Returns
A Meridian model spec container.

serialize

View source

Serializes the given ModelSpec into a Hyperparameters proto.