class_docstr: GSSPlugin replay plugin.
  
  Code adapted from the repository:
  https://github.com/RaptorMai/online-continual-learning
  Handles an external memory fulled with samples selected
  using the Greedy approach of GSS algorithm.
  `before_forward` callback is used to process the current
  sample and estimate a score.
docstr: Args:
      buffer: memory buffer
      grad_dims: gradient dimensions
      batch_x: current batch x
      batch_y: current batch y
  Returns: score of current batch, gradient from memory subsets
docstr_tok: ["Args",":","buffer",":","memory","buffer","grad_dims",":","gradient","dimensions","batch_x",":","current","batch","x","batch_y",":","current","batch","y","Returns",":","score","of","current","batch",",","gradient","from","memory","subsets"]
code: def get_batch_sim(self, strategy, grad_dims, batch_x, batch_y):
      """
      Args:
          buffer: memory buffer
          grad_dims: gradient dimensions
          batch_x: current batch x
          batch_y: current batch y
      Returns: score of current batch, gradient from memory subsets
      """
      mem_grads = self.get_rand_mem_grads(
          strategy, grad_dims, len(batch_x)
      )
      strategy.model.zero_grad()
      loss = strategy._criterion(
          strategy.model.forward(batch_x), batch_y
      )
      loss.backward()
      batch_grad = self.get_grad_vector(
          strategy.model.parameters, grad_dims
      ).unsqueeze(0)
      batch_sim = max(self.cosine_similarity(mem_grads, batch_grad))
      return batch_sim, mem_grads
  
file_path: avalanche/avalanche/training/plugins/gss_greedy.py
imports: from typing import TYPE_CHECKING
  import torch
  from avalanche.benchmarks.utils import _make_taskaware_classification_dataset
  from avalanche.benchmarks.utils.data_loader import ReplayDataLoader
  from avalanche.training.plugins.strategy_plugin import SupervisedPlugin
label_desc: Use image node_id 5 for calling the GSS_greedyPlugin obj's underlying member method code with example usage: obj.get_batch_sim(strategy, grad_dims, batch_x, batch_y) and returns: batch_sim,  mem_grads