INNER CODE UNIT · Python

nr_mix

nv-tlabs/ATISS · scene_synthesis/losses/__init__.py:59

    nr_mix = pred.shape[-1] // 3

    # unpack parameters. (B, T, num_mixtures) x 3
    logit_probs = pred[:, :, :nr_mix]
    means = pred[:, :, nr_mix:2 * nr_mix]
    log_scales = torch.clamp(
        pred[:, :, 2 * nr_mix:3 * nr_mix], min=log_scale_min
    )

    centered_y = target - means
    inv_stdv = torch.exp(-log_scales)
    plus_in = inv_stdv * (centered_y + 1. / (num_classes - 1))
    cdf_plus = torch.sigmoid(plus_in)
    min_in = inv_stdv * (centered_y - 1. / (num_classes - 1))
    cdf_min = torch.sigmoid(min_in)

    # log probability for edge case of 0 (before scaling)
    # equivalent: torch.log(torch.sigmoid(plus_in))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…