Conv2DLayer.py 文件源码

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

项目:deep-motion-analysis 作者: Brimborough 项目源码 文件源码
def __init__(self, rng, filter_shape, input_shape, scale=1.0):

        self.filter_shape = filter_shape
        self.input_shape = input_shape
        self.output_shape = (input_shape[0], filter_shape[0], input_shape[2], input_shape[3])
        self.input_units = np.prod(self.input_shape)
        self.output_units = np.prod(self.output_shape)

        self.theano_rng = RandomStreams(rng.randint(2 ** 30))

        fan_in = np.prod(filter_shape[1:])
        fan_out = filter_shape[0] * np.prod(filter_shape[2:])

        W_bound = scale * np.sqrt(6. / (fan_in + fan_out))
        W = np.asarray(
                rng.uniform(low=-W_bound, high=W_bound, size=filter_shape),
                dtype=theano.config.floatX)

        b = np.zeros((filter_shape[0],), dtype=theano.config.floatX)

        self.W = theano.shared(value=W, borrow=True)
        self.b = theano.shared(value=b, borrow=True)
        self.params = [self.W, self.b]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号