Skip to content

一维数据全连接层结果不对  #70

@budaLi

Description

@budaLi

模型输入为 30个数字,经过多层全连接,每层全连接加了relu,输出的结果不对 debug看好像不会对torch的这种网络做激活层的输出,有什么好的修改办法吗。

demo网络如下。

class SmallNet(nn.Module):  


    def __init__(self):
        super(SmallNet, self).__init__()
        self.fc1 = nn.Linear(30, 128)
        self.fc2 = nn.Linear(128, 64) 
        self.fc3 = nn.Linear(64, 2)  


    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = torch.relu(self.fc2(x))
        x = self.fc3(x)
        return x

debug到tm_run中看到mdl->b->layer_cnt 输出为3 ,依次打印网络:
h->type 2 h->type 2 h->type 2 只有全连接层

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions