I had a question regarding why we have coeff, and why its implemented the way it is.
In forward we calculate different kl_divergences,
| var |
# |
comment |
| kl_alpha |
topic_num * time_slice_num |
(kl divergences summed) |
| kl_eta |
time_slice_num |
(kl divergences summed) |
| kl_theta |
batch_size * coeff |
(kl divergences summed) |
| nll |
batch_size * coeff |
(losses summed) |
---->
| var |
# |
comment |
| kl_theta |
batch_size * #dataset_docs/#batch_size |
(kl divergences summed) |
| nll |
batch_size * #dataset_docs/#batch_size |
(losses summed) |
So kl_theta and nll are scaled up depending on training dataset size.
That means that the larger the training dataset is, the less important it becomes that kl_alpha and kl_eta stay within the gaussian walk prior. Which doesnt seem like it is what we want?
I was wondering if this might explain why I felt the topic word distributions seemed to sometimes jump from one topic to another topic in the scifi project.
relevant code:
def forward(self, bows, normalized_bows, times, rnn_inp, num_docs):
...
bsz = normalized_bows.size(0)
coeff = num_docs / bsz
...
kl_theta = kl_theta.sum() * coeff
...
nll = nll.sum() * coeff
nelbo = nll + kl_alpha + kl_eta + kl_theta
return nelbo, nll, kl_alpha, kl_eta, kl_theta
loss, nll, kl_alpha, kl_eta, kl_theta = model(
...
len(train_docs),
)
I had a question regarding why we have coeff, and why its implemented the way it is.
In forward we calculate different kl_divergences,
---->
So kl_theta and nll are scaled up depending on training dataset size.
That means that the larger the training dataset is, the less important it becomes that kl_alpha and kl_eta stay within the gaussian walk prior. Which doesnt seem like it is what we want?
I was wondering if this might explain why I felt the topic word distributions seemed to sometimes jump from one topic to another topic in the scifi project.
relevant code: