class_docstr: Equivalent to IncrementalClassifier but using the cosine layer
  described in "Learning a Unified Classifier Incrementally via Rebalancing"
  by Saihui Hou et al.
class_docstr_tok: ["Equivalent","to","IncrementalClassifier","but","using","the","cosine","layer","described","in","``","Learning","a","Unified","Classifier","Incrementally","via","Rebalancing","''","by","Saihui","Hou","et","al","."]
code: def forward(self, x):
      unmapped_logits = self.fc(x)
  
      # Mask by default unseen classes
      mapped_logits = (
          torch.ones(len(unmapped_logits), np.max(self.class_order) + 1)
          * -1000
      )
      mapped_logits.to(x.device)
  
      # Now map to classes
      mapped_logits[:, self.class_order] = unmapped_logits
  
      return mapped_logits
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  import numpy
  from avalanche.models import DynamicModule
label_desc: Use image node_id 3 for calling the CosineIncrementalClassifier obj's underlying member method code with example usage: obj.forward(x) and returns: mapped_logits