This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
standard discriminative gaussian | |
y ~ N(f(x), sigma^2) | |
as well as heteroscedastic model | |
y ~ N(f(x), sigma^2(x)) | |
training on a dataset requiring the heteroscedastic model: | |
x in R, y in R^2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pseudocode impl | |
# Algorithm 1 Pseudocode in a PyTorch-like style. | |
# for x in loader: # x: batch with B sequences | |
# # Split image into patches | |
# # B x C x T x H x W -> B x C x T x N x h x w | |
# x = unfold(x, (patch_size, patch_size)) | |
# x = spatial_jitter(x) | |
# # Embed patches (B x C x T x N) | |
# v = l2_norm(resnet(x)) |
OlderNewer