Module: tfl.premade

View source on GitHub

TF Lattice premade models implement typical monotonic model architectures.

You can use TFL premade models to easily construct commonly used monotonic model architectures. To construct a TFL premade model, construct a model configuration from tfl.configs and pass it to the premade model constructor. No fields in the model config will be automatically filled in, so the config must be fully specified. Note that the inputs to the model should match the order in which they are defined in the feature configs.

model_config = tfl.configs.CalibratedLatticeConfig(...)
calibrated_lattice_model = tfl.premade.CalibratedLattice(
    model_config=model_config)
calibrated_lattice_model.compile(...)
calibrated_lattice_model.fit(...)

Supported models are defined in tfl.configs. Each model architecture can be used the same as any other tf.keras.Model.

Modules

premade_lib module: Implementation of algorithms required for premade models.

Classes

class AggregateFunction: Premade model for Tensorflow aggregate function learning models.

class CalibratedLattice: Premade model for Tensorflow calibrated lattice models.

class CalibratedLatticeEnsemble: Premade model for Tensorflow calibrated lattice ensemble models.

class CalibratedLinear: Premade model for Tensorflow calibrated linear models.

Functions

get_custom_objects(...): Creates and returns a dictionary mapping names to custom objects.