Closed mbisan closed 1 year ago
reg is there only for stability reasons. The comment "useless" is there to note that the gradient does not pass through reg due to .detach() in line below.
What about the scaling factor and not separating the costs of $P(d_{in}|x)$?
Indeed, eq. (15) is missing \beta near \ln P(din|x) and the scaling factor in \ln p(x). I'll fix that in the next revision of the manuscript. Thanks for pointing that out. However, note that these are just implementation details, so you can still get the intuition from eq. (15).
Ok, as I understand the formula implemented is the following:
$$L(\theta, \gamma) = \mathbb{E}{x, y\in D{in}}[ \ln(P(y|x) + \beta \ln P(d{in}|x))] + \beta \mathbb{E}{x\in D{out}}[ \ln(P(d{out}|x) + \delta \ln \hat{p} (x))] $$
Where $\delta$ is a scaling factor.
Thank you!
Hi, I've been trying to use this model (DLV3+) with a different dataset, showing only images without pedestrians, then trying to detect them with the anomaly detector. Due to very poor results I reviewed the training loop to understand where it might be failing.
in the file semseg_negatives_joint_th.py the implementation of the cost function after producing the model outputs is the following:
I'm trying to link the different parts of the loss to the different parts of the formula above (Formula 15 in the paper). For inlier pixels,
loss_seg
corresponds to $P(y|x)$,loss_th
includes the cost for inliers $P(d{in}|x)$ and the cost of outliers $P(d{out}|x)$, which is scaled by10*beta
. In the formula above the cost corresponding to $P(d_{in}|x)$ is not scaled by beta, while in the implementation it is. Why is that?For
loss_ood
, which corresponds to $\hat{p}(x)$, I suppose the valuereg
is simply being added for numerical stability reasons?I'm also confused as to why there is a "useless" comment on the line.