Menu

Module providing Consciousness Exploration Tools for PyTorch.

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 consciousnet.models.brainnetcnn.BrainNetCNN(input_shape, in_channels, num_classes, nb_e2e=32, nb_e2n=64, nb_n2g=30, dropout=0.5, leaky_alpha=0.33, twice_e2e=False, dense_sml=True)[source]

BrainNetCNN.

BrainNetCNN is composed of novel edge-to-edge, edge-to-node and node-to-graph convolutional filters (layers) that leverage the topological locality of structural brain networks.

An E2E filter computes a weighted sum of edge weights over all edges connected either to node i or j, like a convolution. An E2N filter summarizes the responses of neighbouring edges into a set of node responses. A N2G filter can be interpreted as getting a single response from all the nodes in the graph.

BrainNetCNN is able to predict an infant’s age with an average error of about 2 weeks, demonstrating that it can learn relevant topological features from the connectome data. BrainNetCNN can also be applied to the much more challenging task of predicting neurodevelopmental scores.

Reference: https://www2.cs.sfu.ca/~hamarneh/ecopy/neuroimage2017.pdf. Code: https://github.com/nicofarr/brainnetcnnVis_pytorch.

__init__(input_shape, in_channels, num_classes, nb_e2e=32, nb_e2n=64, nb_n2g=30, dropout=0.5, leaky_alpha=0.33, twice_e2e=False, dense_sml=True)[source]

Init class.

Parameters

input_shape : tuple

the size of the functional connectivity matrix.

in_channels : int

number of channels in the input tensor.

num_classes : int

the number of classes to be predicted.

twice_e2e : bool, default False

if set use two E2E filter twice.

nb_e2e : int, default 32

number of e2e filters.

nb_e2n : int, default 64

number of e2n filters.

nb_n2g : int, default 30

number of n2g filters.

dropout : float, default 0.5

the dropout rate.

leaky_alpha : float, default 0.33

leaky ReLU alpha rate.

twice_e2e : bool, default False

if set apply two times the Edge-to-Edge layer.

dense_sml : bool, default True

if set reduce the number of hidden dense layers otherwise set nb_n2g to 256.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Follow us

© 2021, consciousnet developers