神经网络输出非二进制值?

发布于 2024-08-29 11:07:53 字数 150 浏览 6 评论 0原文

我最近一直在研究人脸检测,很多文献都指出它们的输出有一个范围。这怎么可能?我创建了自己的网络,它似乎只输出 -1 或 1。这是因为我正在使用 Tanh 激活函数吗?我希望输出的值在某个范围内,例如 0 到 1,而不是二进制输出,这样我就可以看到它认为输出实际上是一张脸的“强度”。谢谢。

I've been looking at face detection lately, and a lot of the literature states their outputs have a range. How is this possible? I've created my own network and it only seems to be outputting either -1 or 1. Is this because I'm using the Tanh activation function? I want the values to output from, say, 0 to 1 in a range, rather than a binary output, so I can see how "strong" it thinks the output is actually a face. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

も让我眼熟你 2024-09-05 11:07:53

您的问题可能是 tanh 的输入范围。
请注意,sigmoid 的工作方式很像 tanh - 它很容易被大数过载。
sigmoid(20) 几乎 = 1
sigmoid(-20) 为 0
首先尝试对输入层的输入进行归一化,以使隐藏层和输出层中的数字较小。

Your problem might be the tanh's input range.
Note that sigmoid works a lot like tanh - it can be easily overloaded by a big number.
sigmoid(20) is almost = 1
and sigmoid(-20) is 0
Try to normalize the input of the input layer first, to have smaller numbers in the hidden layer(s), and in the output layer as well.

笨笨の傻瓜 2024-09-05 11:07:53

是的......你的激活函数决定了你的价值观。如果您不在我们的输出神经元上放置激活函数,那么它将简单地输出值的总和......这种情况会给您非均匀输出和非均匀期望值之间的实际误差。

当然,如果你标准化你的期望值,那么你可以保留你的激活函数。

Yes... your activation function determines your values. If you don't put an activation function on our output neurons, then it will simply output the sum of the values... that case would give you the actual error between your nonuniform output and nonuniform expected values.

Of course if you normalize your expected values, then you can keep your activation function.

背叛残局 2024-09-05 11:07:53

好的,我认为发生的情况是 Tanh 函数过早达到 1。我现在在输出层上更改为 Sigmoid 激活函数,并且我得到了更多不同的答案! :) 伟大的。谢谢。

OK so I think what was going on was that the Tanh function reaches 1 too soon. I've changed to a Sigmoid activation function now on the output layer and I'm getting a lot more varied answers! :) Great. Thanks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文