neodroidvision.utilities.visualisation.grad_cam.GradientClassActivationMapping

class neodroidvision.utilities.visualisation.grad_cam.GradientClassActivationMapping(model: Module, feature_module: Module, target_layer_names: Sequence, use_cuda: bool)[source]

Bases: object

description

__init__(model: Module, feature_module: Module, target_layer_names: Sequence, use_cuda: bool)[source]

Methods

__init__(model, feature_module, ...)

forward(input_img)

param input_img

class ModelOutputs(model, feature_module, target_layers)[source]

Bases: object

Class for making a forward pass, and getting: 1. The network output. 2. Activations from intermeddiate targetted layers. 3. Gradients from intermeddiate targetted layers.

class FeatureExtractor(model, target_layers)[source]

Bases: object

Class for extracting activations and registering gradients from targetted intermediate layers

save_gradient(grad)[source]
Parameters

grad

get_gradients()[source]

Returns:

forward(input_img)[source]
Parameters

input_img

Returns: