Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

Module: tfl.lattice_lib

View source on GitHub

Implementation of algorithms required for Lattice layer.

Functions

assert_constraints(...): Asserts that weights satisfy constraints.

batch_outer_operation(...): Computes outer operation of last dimensions of each of given tensors.

canonicalize_monotonicities(...): Converts string constants representing monotonicities into integers.

canonicalize_trust(...): Converts string constants representing trust direction into integers.

canonicalize_unimodalities(...): Converts string constants representing unimodalities into integers.

compute_interpolation_weights(...): Computes weights for lattice interpolation.

count_non_zeros(...): Returns total number of non 0 elements in given iterables.

finalize_constraints(...): Approximately projects lattice weights to strictly satisfy all constraints.

laplacian_regularizer(...): Returns Laplacian regularization loss for Lattice layer.

linear_initializer(...): Returns a lattice layer weight tensor that represents a linear function.

project_by_dykstra(...): Applies dykstra's projection algorithm for monotonicity/trust constraints.

random_monotonic_initializer(...): Returns a uniformly random sampled monotonic lattice layer weight tensor.

torsion_regularizer(...): Returns Torsion regularization loss for Lattice layer.

verify_hyperparameters(...): Verifies that all given hyperparameters are consistent.