Menu

Deep learning for NeuroImaging in Python.

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.vgg.SphericalVGG(input_channels, cfg, n_classes, input_order=5, conv_mode='DiNe', dine_size=1, repa_size=5, repa_zoom=5, dynamic_repa_zoom=False, hidden_dim=4096, batch_norm=False, fusion_level=1, init_weights=True, standard_ico=False, cachedir=None)[source]

Spherical VGG architecture.

See also

SphericalGVGG

Notes

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

Examples

>>> import torch
>>> from surfify.utils import icosahedron
>>> from surfify.models import SphericalVGG11
>>> verts, tris = icosahedron(order=6)
>>> x = torch.zeros((1, 2, len(verts)))
>>> model = SphericalVGG11(
>>>     input_channels=2, n_classes=10, input_order=6,
>>>     conv_mode="DiNe", dine_size=1, hidden_dim=512,
>>>     fusion_level=2, init_weights=True, standard_ico=False)
>>> print(model)
>>> out = model(x, x)
>>> print(out.shape)

Init class.

Parameters:

input_channels : int

the number of input channels.

cfg : list

the definition of layers where ‘M’ stands for max pooling.

num_classes : int

the number of class in the classification problem.

input_order : int, default 5

the input icosahedron order.

conv_mode : str, default ‘DiNe’

use either ‘RePa’ - Rectangular Patch convolution method or ‘DiNe’ - 1 ring Direct Neighbor convolution method.

dine_size : int, default 1

the size of the spherical convolution filter, ie. the number of neighbor rings to be considered.

repa_size : int, default 5

the size of the rectangular grid in the tangent space.

repa_zoom : int, default 5

control the rectangular grid spacing in the tangent space by applying a multiplicative factor of 1 / repa_zoom.

dynamic_repa_zoom : bool, default False

dynamically adapt the RePa zoom by applying a multiplicative factor of log(order + 1) + 1.

hidden_dim : int, default 4096

the 2-layer classification MLP number of hidden dims.

batch_norm : bool, default False

wether or not to use batch normalization after a convolution layer.

fusion_level : int, default 1

at which max pooling level left and right hemisphere data are concatenated.

init_weights : bool, default True

initialize network weights.

standard_ico : bool, default False

optionaly use surfify tesselation.

cachedir : str, default None

set this folder to use smart caching speedup.

forward(left_x, right_x)[source]

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:

out : torch.Tensor

the prediction.

Follow us

© 2025, nidl developers