pytorch模型最后添加新层add_module

model.fc.add_module('5', nn.Sigmoid())  #add sigmoid
在 fc 后面添加新的层  (5): Sigmoid()   

out add sigmoid layer
  (fc): Sequential(
    (0): Linear(in_features=2048, out_features=1024, bias=True)
    (1): ReLU()
    (2): BatchNorm1d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (3): Dropout(p=0.5, inplace=False)
    (4): Linear(in_features=1024, out_features=109, bias=True)
    (5): Sigmoid()
上一篇:MySQL 查看数据库数据表空间大小


下一篇:MySQL错误“ERROR 2006 (HY000):MySQL server has gone away”