Closed arrowx123 closed 6 years ago
The number of keypoints should be >= 2 when using canned lattice estimators. See: https://github.com/tensorflow/lattice/blob/master/tensorflow_lattice/python/lib/keypoints_initialization.py#L342 Note that 2 keypoints (apart from scaling and shifting) does not do any calibration.
Thank you very much Mahdi!
So the minimum value of num_keypoints
is 2
, and this also follows the notation used in the paper (C_d
in Section 9.3).
Maybe it is a good idea to change the document (like this one https://github.com/tensorflow/lattice/blob/master/g3doc/api_docs/python/tensorflow_lattice/CalibratedHParams.md
), because it says num_keypoints
can be 0
or None
?
Thanks. Will do.
I am playing with the original lattice model (
calibrated_lattice_classifier
) included inuci_census.py
. The program crashes when setting thenum_keypoints
to 0, with the following error:The problem seems to be related to this line
keypoints_initializer = tools.cast_to_dict(keypoints_initializer, feature_names, 'keypoints_initializer')
in thepwl_calibration_layers.py
file. Whennum_keypoints
is0
, thekeypoints_initializer
dict is empty, which gives rise to the error of thecast_to_dict
function. After I manually comment that line and set thekeypoints_initializer
dict to empty, the program runs successfully. Any help is much appreciated! :heart: