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.nn.modules.IcoPool(down_neigh_indices, down_indices, pooling_type='mean')[source]

The pooling layer on icosahedron discretized sphere using 1-ring filter: can perform a mean or max pooling.

Notes

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

Examples

>>> import torch
>>> from surfify.nn import IcoPool
>>> from surfify.utils import downsample, icosahedron, neighbors
>>> ico2_vertices, ico2_triangles = icosahedron(order=2)
>>> ico3_vertices, ico3_triangles = icosahedron(order=3)
>>> down_neigh_indices = neighbors(
        ico2_vertices, ico2_triangles, depth=1, direct_neighbor=True)
>>> down_neigh_indices = np.asarray(list(down_neigh_indices.values()))
>>> down_indices = downsample(ico3_vertices, ico2_vertices)
>>> module = IcoPool(
        down_neigh_indices=down_neigh_indices, down_indices=down_indices)
>>> ico3_x = torch.zeros((10, 4, len(ico3_vertices)))
>>> ico2_x, _ = module(ico3_x)
>>> ico2_x.shape, ico3_x.shape

Init IcoPool.

Parameters:

down_neigh_indices : array

downsampling neighborhood indices at sampling i + 1.

down_indices : array

downsampling indices at sampling i.

pooling_type : str, default ‘mean’

the pooling type: ‘mean’ or ‘max’.

forward(x)[source]

Forward method.

Follow us

© 2025, nidl developers