tfl.lattice_lib.canonicalize_unimodalities

View source on GitHub

Converts string constants representing unimodalities into integers.

tfl.lattice_lib.canonicalize_unimodalities(unimodalities)

Args:

  • unimodalities: unimodalities hyperparameter of Lattice layer.

Raises:

ValueError if one of unimodalities is invalid.

Returns:

unimodalities represented as 0 or 1.