tensorflow / lattice

Lattice methods in TensorFlow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example to train a lattice model with monotonic constraints

PoorvaRane opened this issue · comments

Hi! Could you please share an example to train a lattice with monotonic constraints?
I tried using projection ops but am facing an error while saving and restoring the model from the checkpoint (similar to Issue #35)

I assume you are using an estimator API. This is an example: https://github.com/tensorflow/lattice/blob/master/examples/coffee_test.py
Please share further details about the error you are getting, including your TF, TFL and python version.

On another note, I suggest you wait for the new library to be released, which uses Keras layers and handles constraints automatically. I expect that to happen in 3-4 weeks.

Thanks @mmilanifard ! I am using the estimator API and tfl.calibration_layer() and tfl.lattice_layer() for the calibrations and lattice. I am also using tf.estimator.train_and_evaluate with tf.estimator.TrainSpec() and tf.estimator.EvalSpec() to train and evaluate my model. I suspect there may also be something to do with the tf.estimator.train_and_evaluate function too.

My TF, TFL and python versions are:

python                           2.7.10
tensorflow                       1.14.0  
tensorflow-lattice               0.9.9 

Alright! I can wait for the new version to be released as well. Thanks!

Sorry for the long delays on this. RFC is out and we are hoping for a release by mid Jan.
PR: tensorflow/community#186
RFC doc