ageron / ageron/handson-ml2

[QUESTION] KL divergence formula for the regularizer layer needs explication

Open
#561 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
30k
Forks
13.1k
PR merge metrics
No merged PRs in 30d

Description

Hi @ageron ,

cell n°44 @ https://github.com/ageron/handson-ml2/blob/master/17_autoencoders_and_gans.ipynb,
you build a KLDivergence Layer,
but the formula you use is little difficult to understand at least for me,

Why
```
kl_divergence(self.target, mean_activities) +
kl_divergence(1. - self.target, 1. - mean_activities)
```
?

and not simply
`kl_divergence(self.target, mean_activities)`
?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.