Download code/probe_fc_dim.py from unknownBrain/survivalanalysis_checkpointing: direct link, hf CLI and curl.
- Browser
- Download file 558 Bytes
-
https://huggingface.co/datasets/unknownBrain/survivalanalysis_checkpointing/resolve/main/code/probe_fc_dim.py
- Command line
-
hf download hf://datasets/unknownBrain/survivalanalysis_checkpointing/code/probe_fc_dim.py
-
curl -L -o probe_fc_dim.py https://huggingface.co/datasets/unknownBrain/survivalanalysis_checkpointing/resolve/main/code/probe_fc_dim.py
558 Bytes
| import torch, sys | |
| sys.path.append('.') | |
| import config | |
| from model.CMTLNet import CMTLNet | |
| model = CMTLNet(in_channels=3, num_classes=2, Arcm=0.5, multi=3).to('cpu') | |
| # Simulate a small batch to see the Fc dimension | |
| dummy_input = torch.zeros(2, 3, 64, 64, 64) # typical shape | |
| with torch.no_grad(): | |
| Fl, Fc = model.ShareTask.get_Sharefeatures(dummy_input) | |
| print(f"Fc shape: {Fc.shape}") | |
| risk_features = model.avgpool(Fc) | |
| risk_features = torch.flatten(risk_features, 1) | |
| print(f"risk_features shape after pool+flatten: {risk_features.shape}") | |