Menu

PyTorch toolbox to work with spherical surfaces.

Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the gallery for the big picture.

class surfify.models.vae.SphericalGVAE(input_channels=1, input_dim=192, latent_dim=64, conv_flts=[64, 128, 128, 256, 256])[source]

Spherical Grided VAE architecture.

Use SpMa - Spherical Mapping convolution method.

See also

SphericalVAE

Notes

Debuging messages can be displayed by changing the log level using setup_logging(level='debug').

References

Representation Learning of Resting State fMRI with Variational Autoencoder, NeuroImage 2021.

__init__(input_channels=1, input_dim=192, latent_dim=64, conv_flts=[64, 128, 128, 256, 256])[source]

Init class.

Parameters

input_channels : int, default 1

the number of input channels.

input_dim : int, default 192

the size of the converted 3-D surface to the 2-D grid.

latent_dim : int, default 64

the size of the stochastic latent state of the SVAE.

conv_flts : list of int

the size of convolutional filters.

decode(z)[source]

The decoder.

Parameters

z : Tensor (samples, <latent_dim>)

the stochastic latent state z.

Returns

left_recon_x : Tensor (samples, <input_channels>, azimuth, elevation)

reconstructed left cortical texture.

right_recon_x : Tensor (samples, <input_channels>, azimuth, elevation)

reconstructed right cortical texture.

encode(left_x, right_x)[source]

The encoder.

Parameters

left_x : Tensor (samples, <input_channels>, azimuth, elevation)

input left cortical texture.

right_x : Tensor (samples, <input_channels>, azimuth, elevation)

input right cortical texture.

Returns

q(z | x) : Normal (batch_size, <latent_dim>)

a Normal distribution.

forward(left_x, right_x)[source]

The forward method.

Parameters

left_x : Tensor (samples, <input_channels>, azimuth, elevation)

input left cortical texture.

right_x : Tensor (samples, <input_channels>, azimuth, elevation)

input right cortical texture.

Returns

left_recon_x : Tensor (samples, <input_channels>, azimuth, elevation)

reconstructed left cortical texture.

right_recon_x : Tensor (samples, <input_channels>, azimuth, elevation)

reconstructed right cortical texture.

reparameterize(q)[source]

Implement the reparametrization trick.

Follow us

© 2021, surfify developers