Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

Module: tfl.premade_lib

View source on GitHub

Implementation of algorithms required for premade models.


class LayerOutputRange: Enum to indicate the output range based on the input of the next layers.


build_calibration_layers(...): Creates a calibration layer for submodels as list of list of features.

build_input_layer(...): Creates a mapping from feature name to tf.keras.Input.

build_lattice_layer(...): Creates a tfl.layers.Lattice layer.

build_linear_layer(...): Creates a tfl.layers.Linear layer initialized to be an average.

build_output_calibration_layer(...): Creates a monotonic output calibration layer with inputs range [0, 1].

set_categorical_monotonicities(...): Maps categorical monotonicities to indices based on specified vocab list.

set_random_lattice_ensemble(...): Sets random lattice ensemble in the given model_config.

verify_config(...): Verifies that the model_config and feature_configs are fully specified.

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'