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

Single-layer linear model

The simplest model is the linear model, where for each class c, the output is a linear combination of the input values:

This output is unbounded.

To get a probability distribution, pi, that sums to 1, the output of the linear model is passed into a softmax function:

Hence, the estimated probability of class c for an input x is rewritten with vectors:

Translated in Python with:

batch_size = 600
n_in = 28 * 28
n_out = 10

x = T.matrix('x')
y = T.ivector('y')
W = theano.shared(
            value=numpy.zeros(
                (n_in, n_out),
                dtype=theano.config.floatX
            ),
            name='W',
            borrow=True
        )
b = theano.shared(
    value=numpy.zeros(
        (n_out,),
        dtype=theano.config.floatX
    ),
    name='b',
    borrow=True
)
model = T.nnet.softmax(T.dot(x, W) + b)

The prediction for a given input is given by the most probable class (maximum probability):

y_pred = T.argmax(model, axis=1)

In this model with a single linear layer, information moves from input to output: it is a feedforward network. The process to compute the output given the input is called forward propagation.

This layer is said fully connected because all outputs,

, are the sum of (are linked to) all inputs values through a multiplicative coefficient:

主站蜘蛛池模板: 兴安盟| 西城区| 台州市| 正镶白旗| 江西省| 潞城市| 晴隆县| 环江| 思南县| 耒阳市| 东城区| 福州市| 连山| 商河县| 廊坊市| 井研县| 陵川县| 东辽县| 衡南县| 从化市| 石阡县| 行唐县| 惠东县| 田阳县| 广汉市| 太白县| 乌鲁木齐市| 张家港市| 博兴县| 连州市| 镇宁| 长春市| 绥棱县| 海兴县| 扶绥县| 张北县| 巧家县| 睢宁县| 项城市| 齐河县| 南京市|