SongTang-x / SwinLSTM

MIT License
110 stars 11 forks source link

hidden_states值 #11

Open guzhanxin6 opened 8 months ago

guzhanxin6 commented 8 months ago

你好,我想知道如果我进行下列初始化,hidden_states传入的值应该为多少。 if name == 'main': model = SwinLSTM(img_size=64, patch_size=2, in_chans=2, embed_dim=64, depths=[12], num_heads=[4, 8], window_size=4, drop_rate=0, attn_drop_rate=0, drop_path_rate=0.1)

input_features = torch.randn(2,2 ,64, 64)  
y=model(input_features,hidden_states)
SongTang-x commented 8 months ago

你好,对于SwinLSTM-B: states = [None] len(num_layers),对于SwinLSTM-D:states_down = [None] len(num_layers), states_up = [None] * len(num_layers),模型会把hidden_states的值初始化为0