Skip to content

Different forward outputs in different model #18

@wuys13

Description

@wuys13

Thank you for sharing this outstanding work!
I notice in your code there are different outputs in different models (https://github.com/mahmoodlab/SurvPath/tree/3f73ddd6705ec67d643020c5bb04fb13f9f382cc/models):

  1. some are risks (e.g., in files of model_SurvPath.py and model_ABMIL.py):

     logits = self.to_logits(embedding)
    
     hazards = torch.sigmoid(logits)
     survival = torch.cumprod(1 - hazards, dim=1)
     risk = -torch.sum(survival, dim=1)
     
     return risk
    
  2. some are logits (e.g., in files of model_MLPWSI.py and model_TMIL.py):

     #---> get logits
     logits = self.to_logits(embedding)
    
     return logits
    
  3. even in some cases you comment out these codes (e.g., model_DeepMISL.py):

     logits  = self.classifier(h).unsqueeze(0) # logits needs to be a [1 x 4] vector 
     # Y_hat = torch.topk(logits, 1, dim = 1)[1]
     # hazards = torch.sigmoid(logits)
     # S = torch.cumprod(1 - hazards, dim=1)
     
     # return hazards, S, Y_hat, None, None
     return logits
    

I wonder this is a modified version for some tests, or you have included some data-processing codes elsewhere (however, I have checked Dataset and collate_fn part and do not find these processings). So is it true to directly use your bash scripts for the models using "logits" as output of forward ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions