Closed ascillitoe closed 1 year ago
Sanity check on od_vae_cifar10.ipynb
. VAE training history with alibi-detect==0.11.3
and tensorflow-probability==0.19
:
782/782 [=] - 68s 77ms/step - loss_ma: 8641.5905
782/782 [=] - 59s 75ms/step - loss_ma: -2348.6304
782/782 [=] - 57s 72ms/step - loss_ma: -3497.9333
782/782 [=] - 57s 72ms/step - loss_ma: -4035.8458
505/782 [.] - ETA: 20s - loss_ma: -4364.4066
History with this PR:
782/782 [=] - 66s 68ms/step - loss_ma: 9755.7217
782/782 [=] - 52s 67ms/step - loss_ma: -2190.6944
782/782 [=] - 52s 66ms/step - loss_ma: -3428.9409
782/782 [=] - 52s 67ms/step - loss_ma: -3992.8471
478/782 [.] - ETA: 19s - loss_ma: -4276.0701
Merging #828 (5337d4b) into master (9256aac) will increase coverage by
0.68%
. The diff coverage is100.00%
.:exclamation: Current head 5337d4b differs from pull request most recent head 4379868. Consider uploading reports for the commit 4379868 to get more accurate results
I think it's fine to have this change be breaking - it would be more unexpected behaviour if we kept it to 0.05
but then implicitly would disregard it if another parameter is passed, I like the current validation of only one parameter being set. Plus I think the actual elbo
loss is not in our public API, in which case we could make it "not breaking" by just updating our library callsites to set sim=0.05
? Not sure what the trade-off is, would suggest checking with the person who first implemented the default args.
Would be good to check all call-sites in the library and on the docs that utilize the elbo
loss to check that everything works as expected with the now changed default if we do go with the change.
Thanks @jklaise. Re our library callsites for elbo
, we set it's kwarg's in the vae outlier detectors, e.g.
But we're already setting sim=0.05
as you describe, so I think we're OK. Since @arnaudvl implemented the loss function I'm tagging him as a reviewer to confirm.
In
tensorflow-probability
v0.20 thescale_identity_multiplier
kwarg given toMultivariateNormalDiag
is removed, meaning the covariance matrix must be specified viascale_diag
(see https://github.com/tensorflow/probability/commit/ca8485023767fc021e277ca1a987449d90f21cea)This PR modifies our
elbo
loss function, so thatscale_diag
is constructed from thesim
kwarg, rather than passing it directly toscale_identity_multiplier
. Currently, only one ofcov_full
,cov_diag
orsim
should be given toelbo
.Breaking change: This currently involves a breaking change since the default value of
sim
inelbo
has been changed fromsim=0.05
tosim=None
. A possible alternative would be to havesim=0.05
as the default, and then setsim=None
under-the-hood when eithercov_diag
orcov_full
are given (i.e.not None
).