Ejemplo n.º 1
0
Archivo: 1d.py Proyecto: jackklys/ISVI
def train_gaussianmixture():
    mu_target = torch.FloatTensor([-1, 0.3])
    logvar_target = torch.FloatTensor([-1, 2])
    # mu_target = torch.FloatTensor([0])
    # logvar_target = torch.FloatTensor([0])
    target = lowd.GaussianMixture(num_mixes, z_dim, mu_target, logvar_target)
    model = getattr(lowd, model_name)(target, z_dim, num_samples)
    train(model)
Ejemplo n.º 2
0
Archivo: 2d.py Proyecto: jackklys/ISVI
def train_gaussianmixture():
    mu_target = torch.FloatTensor([[-1, 3], [0, 3]])
    logvar_target = torch.FloatTensor([[-2, 1], [-1, -2]])
    # B = torch.eye(num_samples)
    # mu_target = torch.FloatTensor([0])
    # logvar_target = torch.FloatTensor([0])
    target = lowd.GaussianMixture(num_mixes, z_dim, mu_target, logvar_target)
    model = getattr(lowd, model_name)(target, z_dim, num_samples)
    train(model)
Ejemplo n.º 3
0
Archivo: 2d.py Proyecto: jackklys/ISVI
def train_standardgaussian():
    # mu_target = torch.FloatTensor([[-1,3],
    #                                 [0,3]])
    # logvar_target = torch.FloatTensor([[-2,1],
    #                                     [-1,-2]])
    # B = torch.eye(num_samples)
    mu_target = torch.FloatTensor([0])
    logvar_target = torch.FloatTensor([0])
    target = lowd.GaussianMixture(num_mixes, z_dim, mu_target, logvar_target)
    model = getattr(lowd, model_name)(target,
                                      z_dim,
                                      num_samples,
                                      FreezeMean=False)
    train(model)
Ejemplo n.º 4
0
def train_standardgaussian():
    # mu_target = torch.FloatTensor([[-1,3],
    #                                 [0,3]])
    # logvar_target = torch.FloatTensor([[-2,1],
    #                                     [-1,-2]])
    # B = torch.eye(num_samples)

    torch.manual_seed(123)
    # mu_target = torch.cat([5 * torch.rand(10, 1) - 1, 5 * torch.rand(10, 1) + 5], 1)
    # logvar_target = torch.cat([-2 * torch.rand(10, 1), torch.rand(10, 1)], 1)
    # print(mu_target)
    # print(logvar_target)
    mu_target = torch.FloatTensor([0])
    logvar_target = torch.FloatTensor([0])
    target = lowd.GaussianMixture(num_mixes, z_dim, mu_target, logvar_target)
    model = getattr(lowd, model_name)(target, z_dim, num_samples)
    train(model)