8000 Questions about the computation of the survival layer in `MCAT_Surv` · Issue #8 · mahmoodlab/MCAT · GitHub
[go: up one dir, main page]

Skip to content

Questions about the computation of the survival layer in MCAT_Surv #8

Open

Description

@huangmozhilv

It seems that the computation of the survival layer in MCAT_Surv(link) is wrong, and logits = self.classifier(h).unsqueeze(0) should be logits = self.classifier(h). With the old version, supposing that the batch_size=6 and n_classes=4, the logits will be of size of (1,6,4), the hazards will be of size of (1,6,4), the Y_hat will be of size of (1,1,4), which certainly does not contain the Y_hat for the 6 samples of the batch. Besides, the S will means the cumulative production of the survival(i.e. 1-hazards) along the batch dimension, what does this mean? This S is of size of (1,6,4), then the len(S) in CoxSurvLoss(link) will be 1, which certainly is not the batch size as expected.

In the end, could you provide the reference of the equations for you to write this cox loss?

Activity

  1. changed the title [-]Typo in computing Y_hat?[/-] [+]Questions about the computation of the survival layer in `MCAT_Surv`[/+] on Sep 21, 2022
  2. huangmozhilv commented on Sep 21, 2022

    @huangmozhilv
    Author

    I figure out the reason. The loss you used was not the same as the original cox loss and was adapted to be used for batch_size=1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0