8000 rvae.decode() fails to decode · Issue #89 · pycroscopy/atomai · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
rvae.decode() fails to decode  #89
Open
@utkarshp1161

Description

@utkarshp1161

Below code expect a 2 dimensional z_mean (like the vanilla vae case)

z_mean, z_std = rvae.encode(norm_patches)
rvae.decode(z_mean)
  • when tried with last two latent variables: rvae.decode(z_mean[:, 1:]) -> the decoded patches look very different

Tried a hacky way to decode following: forward_compute_elbo

z_mean, z_std = rvae.encode(norm_patches)
z1, z2, z3 = z_mean[:,0], z_mean[:, 1:3], z_mean[:, 3:]
x_coord_ = rvae.x_coord.expand(norm_patches.shape[0], *rvae.x_coord.size()).cpu()
phi = torch.tensor(z1) # angle
dx = torch.tensor(z2)  # translation
dx = (dx * rvae.dx_prior).unsqueeze(1)
x_coord_ = utils.transform_coordinates(x_coord_, phi, dx)
decoded_patches = rvae.decoder_net(x_coord_.to("cuda"), torch.tensor(z3).to("cuda"))

It will be useful to have this functionality directly using vae.decode(z_mean)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0