Helper Module for Deep Learning.
Module that provides the spherical UNet architecture.
-
class
pynet.models.spherical.unet.DownBlock(conv_layer, in_ch, out_ch, conv_neigh_indices, down_neigh_indices, down_indices, pool_mode='mean', first=False)[source]¶ Downsampling block in spherical UNet: mean pooling => (conv => BN => ReLU) * 2
-
__init__(conv_layer, in_ch, out_ch, conv_neigh_indices, down_neigh_indices, down_indices, pool_mode='mean', first=False)[source]¶ Init.
- Parameters
conv_layer: nn.Module
the convolutional layer on icosahedron discretized sphere.
in_ch: int
input features/channels.
out_ch: int
output features/channels.
conv_neigh_indices: array
conv layer’s filters’ neighborhood indices at sampling i.
down_neigh_indices: array
conv layer’s filters’ neighborhood indices at sampling i + 1.
down_indices: array
downsampling indices at sampling i.
pool_mode: str, default ‘mean’
the pooling mode: ‘mean’ or ‘max’.
first: bool, default False
if set skip the pooling block.
-
-
class
pynet.models.spherical.unet.Ico(order, vertices, triangles, neighbor_indices, down_indices, up_indices, conv_neighbor_indices)¶ -
property
conv_neighbor_indices¶ Alias for field number 6
-
property
down_indices¶ Alias for field number 4
-
property
neighbor_indices¶ Alias for field number 3
-
property
order¶ Alias for field number 0
-
property
triangles¶ Alias for field number 2
-
property
up_indices¶ Alias for field number 5
-
property
vertices¶ Alias for field number 1
-
property
-
class
pynet.models.spherical.unet.SphericalUNet(in_order, in_channels, out_channels, depth=5, start_filts=32, conv_mode='1ring', up_mode='interp', cachedir=None)[source]¶ Define the Spherical UNet structure.
https://github.com/zhaofenqiang/Spherical_U-Net Spherical U-Net on Cortical Surfaces: Methods and Applications
-
__init__(in_order, in_channels, out_channels, depth=5, start_filts=32, conv_mode='1ring', up_mode='interp', cachedir=None)[source]¶ Initialize the Spherical UNet.
- Parameters
in_order: int
the input icosahedron order.
in_channels: int
input features/channels.
out_channels: int
output features/channels.
depth: int, default 5
number of layers in the UNet.
start_filts: int, default 32
number of convolutional filters for the first conv.
conv_mode: str, default ‘1ring’
the size of the spherical convolution filter: ‘1ring’ or ‘2ring’. Can also use rectangular grid projection: ‘repa’.
up_mode: str, default ‘interp’
type of upsampling: ‘transpose’ for transpose convolution (1 ring), ‘interp’ for nearest neighbor linear interpolation, ‘maxpad’ for max pooling shifted zero padding, and ‘zeropad’ for classical zero padding.
cachedir: str, default None
set tthis folder tu use smart caching speedup.
-
-
class
pynet.models.spherical.unet.UpBlock(conv_layer, in_ch, out_ch, conv_neigh_indices, neigh_indices, up_neigh_indices, down_indices, up_mode)[source]¶ Define the upsamping block in spherical UNet: upconv => (conv => BN => ReLU) * 2
-
__init__(conv_layer, in_ch, out_ch, conv_neigh_indices, neigh_indices, up_neigh_indices, down_indices, up_mode)[source]¶ Init.
- Parameters
conv_layer: nn.Module
the convolutional layer on icosahedron discretized sphere.
in_ch: int
input features/channels.
out_ch: int
output features/channels.
conv_neigh_indices: tensor, int
conv layer’s filters’ neighborhood indices at sampling i.
neigh_indices: tensor, int
neighborhood indices at sampling i.
up_neigh_indices: array
upsampling neighborhood indices at sampling i + 1.
down_indices: array
downsampling indices at sampling i.
up_mode: str, default ‘interp’
type of upsampling: ‘transpose’ for transpose convolution, ‘interp’ for nearest neighbor linear interpolation, ‘maxpad’ for max pooling shifted zero padding, and ‘zeropad’ for classical zero padding.
-
Follow us
Inspired by AZMIND template.