[MUSIC PLAYING]
MAYA GUPTA: TensorFlow Lattice is useful
when you have global trends you want your model
to respect even if your training data is very noisy.
For example, imagine you're training a model
to predict the time it will take to get across town.
You know that as traffic gets worse it should take longer.
But with noisy training examples and a very flexible model,
the machine learning might not pick up this basic trend.
TensorFlow Lattice can ensure your model
learns the trends you want.
So what is a lattice?
A lattice is an interpolated lookup table
that can approximate any input/output relations
from your data.
You might remember seeing a simple lattice
in the back of your geometry textbook
to approximate the sine function.
That was an interpolated lookup table on just one input.
And if the exact value you're looking for is in the table,
you can use it.
Otherwise, you find the nearest values in the lookup table
to the one you want, and you interpolate between them
to get the output you want.
Lattices are interpolated lookup tables
that could be keyed by multiple inputs
so we can approximate multi-dimensional functions.
In fact, if you use a lattice with enough lookup table
values, you can represent any input/output relationship.
How does it figure out the lookup table values?
The machine learning trains the lookup table
values on your training examples to minimize the loss.
SEUNGIL YOU: Lattices can help us represent any function,
but what's great about lattices is you can restrict them
so that they behave sensibly rather than feeding
the noise in the data.
Suppose you're designing a model to recommend
coffee shops to users.
You may want your system to recommend the closest coffee
shop if all other characteristics of each coffee
shop are exactly the same.
This type of prior knowledge is called monotonicity.
If we have noisy data, machine learning
doesn't always pick up these global trends.
For example, say you train your model on examples from Tokyo
where you can walk to many coffee shops.
So you don't have much training data for coffee shops
a few kilometers out.
And the data is noisy, so the model doesn't
learn the global trend--
users prefer nearer coffee shops.
If we try to use the model in Texas where
you have to drive to get coffee, we
may be surprised by the model's unexpected behavior
for faraway coffee shops.
With lattice models, you can easily
train a model that captures your prior knowledge about which
subset of inputs should be monotonically increasing
or decreasing inputs.
Under the hood, we express monotonicity
as constraints on the lookup table parameters.
We formulate the machine learning task
as a constraint optimization problem
and use TensorFlow to train it.
After the training is done, the trained model
satisfies any monotonic relationship you choose.
Going back to the coffee shop recommendation example,
you can specify that the recommendation score
decreases with the distance but increases with the coffee
quality.
The monotonic model can behave much more sensibly on the Texas
examples compared to a non-monotonic flexible
function.
Capturing your prior knowledge about monotonic relationships
really helps such analyzation, especially when
the testing data distribution is very
different from the training data distribution.
JAN PFEIFER: In TensorFlow Lattice,
we provide four TensorFlow estimators
that are easy to use and fit different types
and sizes of problems.
We also provide a hyperparameters class
that allows to specify for each feature
its monotonicity, its smoothness regularization, and how
to handle its missing value.
Besides the usual L1 and L2 regularizers,
Lattice models also support graph Laplacian and torsion
regularizers.
Both can help your model generalize better
to unexplored parts of your feature space
and can be configured per feature
with the hyperparameters class.
TensorFlow Lattice can also help you build customized models
by providing calibration and lattices
as layers or as individual TensorFlow operators.
For instance, you could extend your already-existing model
with a lattice layer that connects
your model and monotonic inputs and have a mixed monotonic
model.
MAYA GUPTA: We're excited to share
TensorFlow Lattice with the developer community
and invite you to experiment.
You can learn more about the technical details
from our paper, "Deep Lattice Networks."
And we wish everyone, happy machine learning.
[MUSIC PLAYING]