layers.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:DL-Benchmarks 作者: DL-Benchmarks 项目源码 文件源码
def __init__(self, input, n_in, n_out):
        self.W = theano.shared(
            value=np.zeros(
                (n_in, n_out),
                dtype=theano.config.floatX
            ),
            name='W',
            borrow=True
        )
        self.b = theano.shared(
            value=np.zeros(
                (n_out,),
                dtype=theano.config.floatX
            ),
            name='b',
            borrow=True
        )
        self.p_y_given_x = T.nnet.softmax(T.dot(input, self.W) + self.b)
        self.y_pred = T.argmax(self.p_y_given_x, axis=1)
        self.params = [self.W, self.b]
        self.input = input
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号