Skip to content
Discussion options

You must be logged in to vote

If I am not overlooking nothing, the forward method of monai.networks.nets.DynUNet:

def forward(self, x):
        out = self.skip_layers(x)
        out = self.output_block(out)
        if self.training and self.deep_supervision:
            out_all = [out]
            for feature_map in self.heads:
                out_all.append(interpolate(feature_map, out.shape[2:]))
            return torch.stack(out_all, dim=1)
        return out

Gives the answer. The final feature map (the one that is not coming from a deep supervision head) is the 0th of the final output, so you can retrive it with:

your_cfg: Dict  # your configuration for DynUNet
input_tensor: torch.Tensor  # input tensor for DynU…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by YerePhy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant