class_docstr: Deep Streaming Linear Discriminant Analysis.
  
  This strategy does not use backpropagation.
  Minibatches are first passed to the pretrained feature extractor.
  The result is processed one element at a time to fit the LDA.
  Original paper:
  "Hayes et. al., Lifelong Machine Learning with Deep Streaming Linear
  Discriminant Analysis, CVPR Workshop, 2020"
  https://openaccess.thecvf.com/content_CVPRW_2020/papers/w15/Hayes_Lifelong_Machine_Learning_With_Deep_Streaming_Linear_Discriminant_Analysis_CVPRW_2020_paper.pdf
class_docstr_tok: ["Deep","Streaming","Linear","Discriminant","Analysis",".","This","strategy","does","not","use","backpropagation",".","Minibatches","are","first","passed","to","the","pretrained","feature","extractor",".","The","result","is","processed","one","element","at","a","time","to","fit","the","LDA",".","Original","paper",":","''","Hayes","et",".","al.",",","Lifelong","Machine","Learning","with","Deep","Streaming","Linear","Discriminant","Analysis",",","CVPR","Workshop",",","2020","''","https",":","\/\/openaccess.thecvf.com\/content_CVPRW_2020\/papers\/w15\/Hayes_Lifelong_Machine_Learning_With_Deep_Streaming_Linear_Discriminant_Analysis_CVPRW_2020_paper.pdf"]
docstr: Fit the SLDA model to a new sample (x,y).
  :param x: a torch tensor of the input data (must be a vector)
  :param y: a torch tensor of the input label
  :return: None
docstr_tok: ["Fit","the","SLDA","model","to","a","new","sample","(","x",",","y",")",".",":","param","x",":","a","torch","tensor","of","the","input","data","(","must","be","a","vector",")",":","param","y",":","a","torch","tensor","of","the","input","label",":","return",":","None"]
code: def fit(self, x, y):
      """
      Fit the SLDA model to a new sample (x,y).
      :param x: a torch tensor of the input data (must be a vector)
      :param y: a torch tensor of the input label
      :return: None
      """
  
      # covariance updates
      if self.streaming_update_sigma:
          x_minus_mu = x - self.muK[y]
          mult = torch.matmul(x_minus_mu.transpose(1, 0), x_minus_mu)
          delta = mult * self.num_updates / (self.num_updates + 1)
          self.Sigma = (self.num_updates * self.Sigma + delta) / (
              self.num_updates + 1
          )
  
      # update class means
      self.muK[y, :] += (x - self.muK[y, :]) / (
          self.cK[y] + 1
      ).unsqueeze(1)
      self.cK[y] += 1
      self.num_updates += 1
  
imports: import warnings
  from typing import Callable, Optional, Sequence, Union
  import os
  import torch
  from avalanche.training.plugins import SupervisedPlugin
  from avalanche.training.templates import SupervisedTemplate
  from avalanche.training.plugins.evaluation import EvaluationPlugin, default_evaluator
  from avalanche.models.dynamic_modules import MultiTaskModule
  from avalanche.models import FeatureExtractorBackbone
label_desc: Use image node_id 5 for calling the StreamingLDA obj's underlying member method code with example usage: obj.fit(x, y) without return types