tfl.lattice_lib.verify_hyperparameters

View source on GitHub

Verifies that all given hyperparameters are consistent.

tfl.lattice_lib.verify_hyperparameters(
    lattice_sizes,
    units=None,
    weights_shape=None,
    input_shape=None,
    monotonicities=None,
    unimodalities=None,
    edgeworth_trusts=None,
    trapezoid_trusts=None,
    monotonic_dominances=None,
    joint_monotonicities=None,
    output_min=None,
    output_max=None,
    regularization_amount=None,
    regularization_info=''
)

This function does not inspect weights themselves. Only their shape. Use assert_constraints() to assert actual weights against constraints.

See tfl.layers.Lattice class level comment for detailed description of arguments.

Args:

  • lattice_sizes: Lattice sizes to check againts.
  • units: Units hyperparameter of Lattice layer.
  • weights_shape: Shape of tensor which represents Lattice layer weights.
  • input_shape: Shape of layer input. Useful only if units is set.
  • monotonicities: Monotonicities hyperparameter of Lattice layer.
  • unimodalities: Unimodalities hyperparameter of Lattice layer.
  • edgeworth_trusts: Edgeworth_trusts hyperparameter of Lattice layer.
  • trapezoid_trusts: Trapezoid_trusts hyperparameter of Lattice layer.
  • monotonic_dominances: Monotonic dominances hyperparameter of Lattice layer.
  • joint_monotonicities: Joint monotonicities hyperparameter of Lattice layer.
  • output_min: Minimum output of Lattice layer.
  • output_max: Maximum output of Lattice layer.
  • regularization_amount: Regularization amount for regularizers.
  • regularization_info: String which describes regularization_amount.

Raises:

  • ValueError: If something is inconsistent.