class_docstr: All metrics used in CLEAR paper.
  More information can be found at:
  https://clear-benchmark.github.io/
class_docstr_tok: ["All","metrics","used","in","CLEAR","paper",".","More","information","can","be","found","at",":","https",":","\/\/clear-benchmark.github.io\/"]
docstr: Given an accuracy matrix, returns the 5 metrics used in CLEAR paper
  
  These are:
      'in_domain' : In-domain accuracy (avg of diagonal)
      'next_domain' : In-domain accuracy (avg of superdiagonal)
      'accuracy' : Accuracy (avg of diagonal + lower triangular)
      'backward_transfer' : BwT (avg of lower triangular)
      'forward_transfer' : FwT (avg of upper triangular)
  
  :param matrix: Accuracy matrix,
      e.g., matrix[5][0] is the test accuracy on 0-th-task at timestamp 5
  :return: A dictionary containing these 5 metrics
docstr_tok: ["Given","an","accuracy","matrix",",","returns","the","5","metrics","used","in","CLEAR","paper","These","are",":","'in_domain","'",":","In-domain","accuracy","(","avg","of","diagonal",")","'next_domain","'",":","In-domain","accuracy","(","avg","of","superdiagonal",")","'accuracy","'",":","Accuracy","(","avg","of","diagonal","+","lower","triangular",")","'backward_transfer","'",":","BwT","(","avg","of","lower","triangular",")","'forward_transfer","'",":","FwT","(","avg","of","upper","triangular",")",":","param","matrix",":","Accuracy","matrix",",","e.g.",",","matrix","[","5","]","[","0","]","is","the","test","accuracy","on","0-th-task","at","timestamp","5",":","return",":","A","dictionary","containing","these","5","metrics"]
code: def get_metrics(self, matrix):
      """Given an accuracy matrix, returns the 5 metrics used in CLEAR paper
  
      These are:
          'in_domain' : In-domain accuracy (avg of diagonal)
          'next_domain' : In-domain accuracy (avg of superdiagonal)
          'accuracy' : Accuracy (avg of diagonal + lower triangular)
          'backward_transfer' : BwT (avg of lower triangular)
          'forward_transfer' : FwT (avg of upper triangular)
  
      :param matrix: Accuracy matrix,
          e.g., matrix[5][0] is the test accuracy on 0-th-task at timestamp 5
      :return: A dictionary containing these 5 metrics
      """
      assert matrix.shape[0] == matrix.shape[1]
      metrics_dict = {
          "in_domain": self.in_domain(matrix),
          "next_domain": self.next_domain(matrix),
          "accuracy": self.accuracy(matrix),
          "forward_transfer": self.forward_transfer(matrix),
          "backward_transfer": self.backward_transfer(matrix),
      }
      return metrics_dict
  
file_path: avalanche/avalanche/benchmarks/classic/clear.py
imports: from pathlib import Path
  from typing import Sequence, Union, Any, Optional
  from avalanche.benchmarks.datasets.clear import _CLEARImage, _CLEARFeature, SEED_LIST, CLEAR_FEATURE_TYPES, _CLEAR_DATA_SPLITS
  from avalanche.benchmarks.scenarios.deprecated.generic_benchmark_creation import create_generic_benchmark_from_paths, create_generic_benchmark_from_tensor_lists
label_desc: Use image node_id 2 for calling the CLEARMetric obj's underlying member method code with example usage: obj.get_metrics(matrix) and returns: metrics_dict