code: def layer_covariance(layer1, layer2=None):
      """Computes the covariance matrix between the neurons of two layers. If only one
      layer is passed, computes the symmetric covariance matrix of that layer.
      """
      layer2 = layer2 or layer1
      act1, act2 = layer1.activations, layer2.activations
      num_datapoints = act1.shape[
          0
      ]  # cast to avoid numpy type promotion during division
      return np.matmul(act1.T, act2) / float(num_datapoints)
  
file_path: lucid/lucid/modelzoo/aligned_activations.py
imports: from __future__ import absolute_import, division, print_function
  from lucid.misc.io.sanitizing import sanitize
  from lucid.misc.io import load
  import numpy
  from cachetools.func import lru_cache
label_desc: Use image node_id 2 for calling a global function with example usage: layer_covariance(layer1, layer2) and returns: unknown