code: def _cam_loss(key, targets_hot, decay):
      def loss(state):
          img = state[torchbearer.MODEL].input_image
          return (
              -torch.masked_select(state[key], targets_hot).sum()
              + decay * img.pow(2).sum()
          )
  
      return loss
  
file_path: torchbearer/torchbearer/callbacks/imaging/inside_cnns.py
imports: import torch
  import torch.nn
  import torch.optim
  import torchbearer
  from torchbearer.callbacks.decorators import once_per_epoch
  from .None import imaging
label_desc: Use image node_id 1 for calling a global function with example usage: _cam_loss(key, targets_hot, decay) and returns: loss, unknown