Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does the normalization apply only to the input? #1

Closed
yaoweihu opened this issue Dec 12, 2019 · 1 comment
Closed

Why does the normalization apply only to the input? #1

yaoweihu opened this issue Dec 12, 2019 · 1 comment

Comments

@yaoweihu
Copy link

yaoweihu commented Dec 12, 2019

Hello, I see your code, and I find that you only apply log and normalization to the in_times? I don't understand why not apply them to in_times and out_times?

@shchur
Copy link
Owner

shchur commented Dec 16, 2019

Since we are using log-likelihood as the evaluation metric, applying transformations to inter-event times (e.g. scaling / logartihm) will change the results. The log-likelihood is defined as \sum_i \log p^*(\tau_i), where p^*(\tau_i) is the conditional density at point \tau_i - we are summing log-densities for all the samples in the dataset. If we transform all the inter-event times \tau_i (e.g. scale / apply log), the densities will also get changed according to the change of variables formula.

Instead, we do the following. All the models considered in our paper are defined as normalizing flows (i.e. a sequence of transformations of a base density).

z_0 ~ p(z_0)
z_1 = g_1(z_0)
...
z_M = g_M(z_{M-1})
tau = f(z_M)

As the final transformation (f in the pseudocode above) we apply scaling / exponentiation (see decoders.py). This way

  1. we obtain a distribution over original inter-event times
  2. the models are easier to train, since the distribution over z_M should have 0 mean and unit variance.

Let me know if this explanation doesn't make sense to you and I will try to clarify it.

@shchur shchur closed this as completed May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants