motionDetector_lasagne.py 文件源码

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

项目:deepgestures_lasagne 作者: nneverova 项目源码 文件源码
def build_network(self, input_var=None):

        self.network= {}

        self.network['input'] = lasagne.layers.InputLayer(shape=(self.batch_size, self.input_size[0]),
                                         input_var=self.x)


        # Add a fully-connected layer of 800 units, using the linear rectifier, and
        # initializing weights with Glorot's scheme (which is the default anyway):
        self.network['FC_1'] = batch_norm(lasagne.layers.DenseLayer(
                lasagne.layers.dropout(self.network['input'], p=self.dropout_rates[0]),  num_units=self.fc_layers[0],
                nonlinearity=lasagne.nonlinearities.tanh,
                W=lasagne.init.GlorotUniform()))


        # Finally, we'll add the fully-connected output layer, of 10 softmax units:
        self.network['prob'] = lasagne.layers.DenseLayer(
                lasagne.layers.dropout(self.network['FC_1'], p=self.dropout_rates[1]), num_units=self.fc_layers[1],
                nonlinearity=lasagne.nonlinearities.softmax)


        # Each layer is linked to its incoming layer(s), so we only need to pass
        # the output layer to give access to a network in Lasagne:
        return self.network
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号