Module connectome.visualization.viz_nn
visualization helpers and functions for convolutional neural networks
Functions
def model_modifier_function(cloned_model)def nn_feature_visualization(model, X, y, method='saliency', average=False, ordered=False)-
Returns plots for different feature attribution methods: Vanilla Saliency and Smooth Saliency. If you want to view e.g. the first 3 visualizations and not the average, but have structural data, the input should follow the format X=[X_test[0][0:3],X_test[1][0:3]], y=y_test[0:3]
Args
model- A fitted neural network model
X- A test dataframe to visualize
y- labels
method- 'saliency' or 'saliency_smooth'
average- Return the average or individual feature maps
ordered- Boolean, whether to reorder the matrices based on the yeo7 network. (True is recommended when training with Brainnetome data. Only applicable to data based on the brainnetome atlas.
Returns
Returns a list feature attribution plots for the desired method
def score_function(output)