When to increase the lattice_sizes?
JaeLee18 opened this issue · comments
I am using TF Lattice for three weeks but I am not quite sure when to increase the "lattice_sizes" in a Lattice layer.
I looked up the TF Lattice official tutorials, but I am somewhat lost to decide the size of lattice.
May I ask you to give me a suggestion to decide the size of lattice?
I do understand a 'd'-dimension lattice is required for 'd' features.
Again, thank you for this amazing library :)
I assume you are asking about the lattice_sizes
parameter of the Lattice
layer or the corresponding parameter in FeatureConfig
. We have found that 2, 3 or 4 are good choices for lattice sizes, and the optimal choice is often found by hyper-parameter search on a validation set. Features with a lot of non-linear interactions with other features might require higher lattice sizes. If you want to increase the complexity of the model class I would suggest using an ensemble of simpler lattices (with lattice_sizes set to 2 or 3) but with separate calibration for each lattice in the ensemble.
Canned estimator for random ensemble: https://www.tensorflow.org/lattice/tutorials/canned_estimators#rtl_layer_random_lattice_ensemble
Premade Keras models for random ensemble:
https://www.tensorflow.org/lattice/tutorials/premade_models#rtl_layer_random_lattice_ensemble