非线性激活函数在神经网络的基本层面上做了什么?

What do non-linear activation functions do at a fundamental level in neural networks?

我一直在尝试找出在神经网络中实施时非线性激活函数的确切作用。

我知道他们修改了神经元的输出,但如何修改以及出于什么目的?

我知道他们将非线性添加到线性神经网络中,但目的是什么?

它们对每一层的输出到底做了什么?是某种形式的分类吗?

我想知道它们在神经网络中的确切用途。

Wikipedia says that "the activation function of a node defines the output of that node given an input or set of inputs." This article 表示激活函数检查神经元是否具有 "fired"。我还查看了更多关于 Stack Overflow 的文章和其他问题,但其中 none 对正在发生的事情给出了令人满意的答案。

使用非线性激活函数的主要原因是能够学习非线性目标函数,即学习输入和输出之间的非线性关系。如果一个网络只包含线性激活函数,它只能模拟输入和输出之间的线性关系,这在几乎所有应用中都没有用。

我绝不是 ML 专家,所以也许这个视频可以更好地解释它:https://www.coursera.org/lecture/neural-networks-deep-learning/why-do-you-need-non-linear-activation-functions-OASKH

希望对您有所帮助!

首先最好清楚我们为什么要使用激活函数。

我们使用激活函数将一层节点的输出传播到 下一层。激活函数是标量到标量的函数,我们使用神经网络中隐藏神经元的激活函数将非线性引入网络模型。所以在更简单的层面上,激活函数用于将非线性引入网络。

那么引入非线性有什么用?在此之前,非线性意味着无法从输入的线性组合中再现输出。因此,如果神经网络中没有非线性激活函数,即使它可能有数百个隐藏层,它仍然会表现得像一个单层感知器。原因是无论您以何种方式求和,都只会产生线性输出。

无论如何,为了更深层次的理解,我建议你看一下 Andrew Ng 本人的这篇 Medium post as well as this video

根据 Andrew Ng 的视频,让我改写下面的一些重要部分。

...if you don't have an activation function, then no matter how many layers your neural network has, all it's doing is just computing a linear activation function. So you might as well not have any hidden layers.

...it turns out that if you have a linear activation function here and a sigmoid function here, then this model is no more expressive than standard logistic regression without any hidden layer.

...so unless you throw a non-linear in there, then you're not computing more interesting functions even as you go deeper in the network.