Closed PoorvaRane closed 4 years ago
Lattice kernel is flattened output values on each vertex (unlike pwl where the kernel encodes the deltas). The kernel you have here is monotonic. e.g. the deltas across the 3rd dim are non-negative.
kernel = tf.reshape(tf.constant(layer.kernel), [2]*6)
assert tf.reduce_min(kernel[:,:,1:,...] - kernel[:,:,:-1,...]) >= 0
The reason behind this design choice was mentioned briefly in the RFC. TL;DR is that these choices speed up training and evaluation.
Referencing the issue here - https://github.com/tensorflow/lattice/issues/49
What is encoded in the lattice kernel? The lattice kernels for most of my signals look monotonic and it appears as though like
tf.cumsum
is not needed. However, for one set of signals, the lattice kernel looks like this:My code for the lattice is: