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

tfl.premade_lib.build_calibration_layers

View source on GitHub

Creates a calibration layer for submodels as list of list of features.

tfl.premade_lib.build_calibration_layers(
    calibration_input_layer, feature_configs, model_config, layer_output_range,
    submodels, separate_calibrators, dtype
)

Args:

  • calibration_input_layer: A mapping from feature name to tf.keras.Input.
  • feature_configs: A list of tfl.configs.FeatureConfig instances that specify configurations for each feature.
  • model_config: Model configuration object describing model architecture. Should be one of the model configs in tfl.configs.
  • layer_output_range: A tfl.premade_lib.LayerOutputRange enum.
  • submodels: A list of list of feature names.
  • separate_calibrators: If features should be separately calibrated for each lattice in an ensemble.
  • dtype: dtype

Returns:

A list of list of Tensors representing a calibration layer for submodels.