View source on GitHub |
Converts string constants representing unimodalities into integers.
tfl.utils.canonicalize_unimodalities(
unimodalities
)
Args | |
---|---|
unimodalities
|
unimodalities hyperparameter of tfl.layers.Lattice layer.
|
Returns | |
---|---|
A list of unimodalities represented as -1, 0, 1, or the value None if unimodalities is None. |
Raises | |
---|---|
ValueError
|
If one of unimodalities is not in the set {-1, 0, 1, 'peak', 'none', 'valley'}. |