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. 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.

Classes

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.

Other Members

  • CALIB_LAYER_NAME = 'tfl_calib'
  • CALIB_PASSTHROUGH_NAME = 'tfl_calib_passthrough'
  • INPUT_LAYER_NAME = 'tfl_input'
  • LATTICE_LAYER_NAME = 'tfl_lattice'
  • LINEAR_LAYER_NAME = 'tfl_linear'
  • OUTPUT_CALIB_LAYER_NAME = 'tfl_output_calib'