nec-research / tf-imle

Tensorflow implementation and notebooks for Implicit Maximum Likelihood Estimation
Other
68 stars 6 forks source link

`k` in IMLESubsetkLayer #2

Closed jatentaki closed 2 years ago

jatentaki commented 2 years ago

In your example code in the README there are two k values: one passed in the constructor and used in IMLESubsetkLayer.subset_k via self.k and one passed directly to IMLESubsetkLayer.subset_k. The latter is seemingly not used for anything except to return from custom_grad. Is this an error which should be replaced by self.k everywhere or am I missing something?

mniepert commented 2 years ago

Correct. The k of IMLESubsetkLayer.subset_k is a remnant of a previous (different) versions of the layer. For some combinatorial optimization problems where the number of 1s in the solutions (k) is not constant, one might pass some (varying) k to the layer to adjust the sum-of-gamma noise perturbations. Here, however, it can be removed completely as it is not used in this instantiation of I-MLE. I'll do this now to avoid misunderstanding.