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: Make predictions on test data X.
  :param X: a torch tensor that contains N data samples (N x d)
  :param return_probas: True if the user would like probabilities instead
  of predictions returned
  :return: the test predictions or probabilities
docstr_tok: ["Make","predictions","on","test","data","X.",":","param","X",":","a","torch","tensor","that","contains","N","data","samples","(","N","x","d",")",":","param","return_probas",":","True","if","the","user","would","like","probabilities","instead","of","predictions","returned",":","return",":","the","test","predictions","or","probabilities"]
code: def predict(self, X):
      """
      Make predictions on test data X.
      :param X: a torch tensor that contains N data samples (N x d)
      :param return_probas: True if the user would like probabilities instead
      of predictions returned
      :return: the test predictions or probabilities
      """
  
      # compute/load Lambda matrix
      if self.prev_num_updates != self.num_updates:
          # there have been updates to the model, compute Lambda
          self.Lambda = torch.pinverse(
              (1 - self.shrinkage_param) * self.Sigma
              + self.shrinkage_param
              * torch.eye(self.input_size, device=self.device)
          )
          self.prev_num_updates = self.num_updates
  
      # parameters for predictions
      M = self.muK.transpose(1, 0)
      W = torch.matmul(self.Lambda, M)
      c = 0.5 * torch.sum(M * W, dim=0)
  
      scores = torch.matmul(X, W) - c
  
      # return predictions or probabilities
      return scores
  
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 6 for calling the StreamingLDA obj's underlying member method code with example usage: obj.predict(X) and returns: scores