File size: 558 Bytes
ee594f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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}")