官术网_书友最值得收藏!

An introduction to neurons

A neuron is a mathematical function that takes one or more input values, and outputs a single numerical value:

In this diagram, we can see the different elements of the neuron

The neuron is defined as follows:

  1. First, we compute the weighted sum  of the inputs xi and the weights wi (also known as an activation value). Here, xi is either numerical values that represent the input data, or the outputs of other neurons (that is, if the neuron is part of a neural network):
    • The weights wi are numerical values that represent either the strength of the inputs or, alternatively, the strength of the connections between the neurons.
    • The weight b is a special value called bias whose input is always 1.
  1. Then, we use the result of the weighted sum as an input to the activation function f, which is also known as transfer function. There are many types of activation functions, but they all have to satisfy the requirement to be non-linear, which we'll explain later in the chapter.
You might have noticed that the neuron is very similar to remove logistic regression and the perceptron, which we discussed in Chapter 1, Machine Learni ng – an Introduction. You can think of it as a generalized version of these two algorithms. If we use the logistic function or step function as activation functions, the neuron turns into logistic regression or perceptron respectively. Additionally, if we don't use any activation function, the neuron turns into linear regression. In this case, however, we are not limited to these cases and, as you'll see later, they are rarely used in practice.

As we mentioned in Chapter 1Machine Learning – an Introduction, the activation value defined previously can be interpreted as the dot product between the vector w and the vector x: . The vector x will be perpendicular to the weight vector w, if . Therefore, all vectors x such that  define a hyperplane in the feature space Rn , where n is the dimension of x.

That sounds complicated! To better understand it, let's consider a special case where the activation function is f(x) = x and we only have a single input value, x. The output of the neuron then becomes y = wx + b, which is the linear equation. This shows that in one-dimensional input space, the neuron defines a line. If we visualize the same for two or more inputs, we'll see that the neuron defines a plane, or a hyperplane, for an arbitrary number of input dimensions.

In the following diagram, we can also see that the role of the bias, bis to allow the hyperplane to shift away from the center of the coordinate system. If we don't use bias, the neuron will have limited representation power:

The preceding diagram displays the hyperplane

We already know from Chapter 1Machine Learning – an Introduction, that the perceptron (hence the neuron) only works with linearly separable classes, and now we know that because it defines a hyperplane. To overcome this limitation, we'll need to organize the neurons in a neural network.

主站蜘蛛池模板: 德阳市| 道孚县| 突泉县| 黑龙江省| 绩溪县| 太湖县| 上栗县| 常州市| 土默特右旗| 上犹县| 合肥市| 襄汾县| 渭源县| 资源县| 资兴市| 平泉县| 贵州省| 崇礼县| 四子王旗| 鄯善县| 手游| 安阳市| 施甸县| 密云县| 嘉祥县| 平塘县| 乌审旗| 沁水县| 哈尔滨市| 沧源| 正定县| 寿光市| 依安县| 卫辉市| 合山市| 丹棱县| 治县。| 怀宁县| 哈巴河县| 民勤县| 呈贡县|