tfl.pwl_calibration_layer.UniformOutputInitializer

Initializes PWL calibration layer to represent linear function.

PWL calibration layer weights are one-d tensor. First element of tensor represents bias. All remaining represent delta in y-value compare to previous point. Aka heights of segments.

output_min Minimum value of PWL calibration output after initialization.
output_max Maximum value of PWL calibration output after initialization.
monotonicity

  • if 'none' or 'increasing', the returned function will go from (input_min, output_min) to (input_max, output_max).
  • if 'decreasing', the returned function will go from (input_min, output_max) to (input_max, output_min).
keypoints
  • if not provided (None or []), all pieces of returned function will have equal heights (i.e. y[i+1] - y[i] is constant).
  • if provided, all pieces of returned function will have equal slopes (i.e. (y[i+1] - y[i]) / (x[i+1] - x[i]) is constant).
  • Methods

    from_config

    Instantiates an initializer from a configuration dictionary.

    Example:

    initializer = RandomUniform(-1, 1)
    config = initializer.get_config()
    initializer = RandomUniform.from_config(config)
    

    Args
    config A Python dictionary, the output of get_config().

    Returns
    An Initializer instance.

    get_config

    View source

    Standard Keras config for serialization.

    __call__

    View source

    Returns weights of PWL calibration layer.

    Args
    shape Must be a collection of the form (k, units) where k >= 2.
    dtype Standard Keras initializer param.
    partition_info Standard Keras initializer param.

    Returns
    Weights of PWL calibration layer.

    Raises
    ValueError If requested shape is invalid for PWL calibration layer weights.