Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
budaLi opened this issue Dec 14, 2023 · 0 comments
Open

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

budaLi opened this issue Dec 14, 2023 · 0 comments

Comments

@budaLi
Copy link

budaLi commented Dec 14, 2023

模型输入为 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 只有全连接层

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant