mnist.py 文件源码

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

项目:python-machine-learning 作者: sho-87 项目源码 文件源码
def basic_conv(n=3, epochs=60):
    nets = []  # list of networks (for ensemble, if desired)
    for j in range(n):
        net = Network([
            ConvPoolLayer(image_shape=(mini_batch_size, 1, 28, 28),
                          filter_shape=(20, 1, 5, 5), stride=(1, 1),
                          poolsize=(2, 2), activation_fn=relu),
            ConvPoolLayer(image_shape=(mini_batch_size, 20, 14, 14), 
                          filter_shape=(40, 20, 5, 5), stride=(1, 1),
                          poolsize=(2, 2), activation_fn=relu),
            FullyConnectedLayer(n_in=40*7*7, n_out=100),
            SoftmaxLayer(n_in=100, n_out=10)], mini_batch_size)

        net.SGD(training_data, epochs, mini_batch_size, 0.1,
                validation_data, test_data)

        nets.append(net)  # Add current network to list
    return nets
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号