tfl.utils.canonicalize_unimodalities

Converts string constants representing unimodalities into integers.

unimodalities unimodalities hyperparameter of tfl.layers.Lattice layer.

A list of unimodalities represented as -1, 0, 1, or the value None if unimodalities is None.

ValueError If one of unimodalities is not in the set {-1, 0, 1, 'peak', 'none', 'valley'}.