Closed chi0tzp closed 3 years ago
The latent_dim
in the make_shifts
call is equal deformator.input_dim
https://github.com/anvoynov/GANLatentDiscovery/blob/master/trainer.py#L195 so that latent_dim == directions_count
in this method, thus it should works fine.
Surprisingly, I just caught another bug related to the shift predictor dimension that could potentially strike once the directions_count
is greater than the generator's latent dimension (fixed here: https://github.com/anvoynov/GANLatentDiscovery/blob/master/run_train.py#L74).
The claim in the paper remains true as the approach does not rely on the latent dimensionality.
For
target_indices
you samplebatch_size
integers from[0, ..., directions_count-1]
and then you createz_shift
as abatch_size x latent_dim
matrix, where for each row, at the column defined bytarget_indices
vector, you assign a (random) shift magnitude value.However, if
directions_count > latent_dim
, then this would fail, since you would try to assign a shift magnitude to a non-existent column ofz_shift
(it has onlylatent_dim
columns). This effectively means that (at least with this version of the code), you cannot discover more directions than the dimensionality of the latent space (you can discover at most as many directions as the dimensionality of the latent space). This might be reasonable in practice, but in the paper it is stated that "The method from (Ramesh et al., 2018) is also limited with the maximal number of discovered directions equal to the latent space dimensionality, while our approach can be applied for a higher number of directions.".Am I missing something here? Thanks for your time.