laymon.monitor

Module Contents

Classes

ObserverHookObject(kwargs) AN object used to store:
FeatureMapMonitor() A monitor type class for visualizing the feature maps of a neural network.
class laymon.monitor.ObserverHookObject(kwargs)[source]

AN object used to store: 1. The observer object which is being hooked 2. Parameters being monitored 3. Handler of the hooked layer

class laymon.monitor.FeatureMapMonitor[source]

Bases: laymon.interfaces.Monitor

A monitor type class for visualizing the feature maps of a neural network.

add_observer(self, layer_observer)[source]
  1. Creates a layer observer object.
  2. Hooks the layer to capture the activation map of the layer.
  3. Adds the observer object to the list of monitored observers.
Parameters:layer_observer – Observer object
remove_observer(self, layer_observer=None, layer_name=None)[source]
If the layer observer/layer name is in the list of monitored observers:
  1. Unhook the layer.
  2. Remove the layer observer from the list of monitored observers.
Parameters:
  • layer_observer – Layer Observer.
  • layer_name – Name of the layer being monitored.
Returns:

True/False based on whether the observer by deleted or not.

static _is_layer_single_dim(layer)[source]

Checks if the layer is a single dimensional layer

_get_activation_map(self, layer_name)[source]

Hooks the layer to capture activation maps for the given layer and return the handler to the hook

notify_observers(self)[source]

Updates all the observers being monitored with the new parameters

get_registered_observers(self)[source]

Returns the list of observers being monitored.