资源简介
基于python2.7的LeNet5源代码实现,效果很不错。
代码片段和文件信息
“““This tutorial introduces the LeNet5 neural network architecture
using Theano. LeNet5 is a convolutional neural network good for
classifying images. This tutorial shows how to build the architecture
and comes with all the hyper-parameters you need to reproduce the
paper‘s MNIST results.
This implementation simplifies the model in the following ways:
- LeNetConvPool doesn‘t implement location-specific gain and bias parameters
- LeNetConvPool doesn‘t implement pooling by average it implements pooling
by max.
- Digit classification is implemented with a logistic regression rather than
an RBF network
- LeNet5 was not fully-connected convolutions at second layer
References:
- Y. LeCun L. Bottou Y. Bengio and P. Haffner:
Gradient-based Learning Applied to Document
Recognition Proceedings of the IEEE 86(11):2278-2324 November 1998.
http://yann.lecun.com/exdb/publis/pdf/lecun-98.pdf
“““
import os
import sys
import time
import numpy
import theano
import theano.tensor as T
from theano.tensor.signal import downsample
from theano.tensor.nnet import conv
from logistic_sgd import LogisticRegression load_data
from mlp import Hiddenlayer
class LeNetConvPoollayer(object):
“““Pool layer of a convolutional network “““
def __init__(self rng input filter_shape image_shape poolsize=(2 2)):
“““
Allocate a LeNetConvPoollayer with shared variable internal parameters.
:type rng: numpy.random.RandomState
:param rng: a random number generator used to initialize weights
:type input: theano.tensor.dtensor4
:param input: symbolic image tensor of shape image_shape
:type filter_shape: tuple or list of length 4
:param filter_shape: (number of filters num input feature maps
filter height filter width)
:type image_shape: tuple or list of length 4
:param image_shape: (batch size num input feature maps
image height image width)
:type poolsize: tuple or list of length 2
:param poolsize: the downsampling (pooling) factor (#rows #cols)
“““
assert image_shape[1] == filter_shape[1]
self.input = input
# there are “num input feature maps * filter height * filter width“
# inputs to each hidden unit
fan_in = numpy.prod(filter_shape[1:])
# each unit in the lower layer receives a gradient from:
# “num output feature maps * filter height * filter width“ /
# pooling size
fan_out = (filter_shape[0] * numpy.prod(filter_shape[2:]) /
numpy.prod(poolsize))
# initialize weights with random weights
W_bound = numpy.sqrt(6. / (fan_in + fan_out))
self.W = theano.shared(
numpy.asarray(
rng.uniform(low=-W_bound high=W_bound size=filter_shape)
dtype=theano.config.floatX
)
borrow=True
)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-09-14 09:19 基于python2.7的LeNet5源代码实现\
文件 12645 2015-08-20 22:08 基于python2.7的LeNet5源代码实现\convolutional_mlp.py
文件 20706 2015-08-20 22:08 基于python2.7的LeNet5源代码实现\convolutional_mlp_commentate.py
目录 0 2015-09-14 09:19 基于python2.7的LeNet5源代码实现\data\
文件 9457 2015-09-02 21:29 基于python2.7的LeNet5源代码实现\logistic_sgd.py
文件 14181 2015-08-20 22:08 基于python2.7的LeNet5源代码实现\mlp.py
相关资源
- caffe_log绘制accuracy和loss曲线python3
- Python+OpenCv实现AI人脸识别身份认证系
- Tensorflow之CNN实现CIFAR-10图像的分类p
- python零基础入门视频 百度云资源
- Python和pyqt5中安装VTK实现三维数据可视
- Python3.x+Pyqt5实现界面左侧导航栏的抽
- Python3.x+Pyqt5制作GUI界面的案例
- Python-2.7.2-xcompile.patch
- PIL中文手册.pdf
- Python操作MySQL数据进行图片存取操作
- win 10 python 3.7 pygraphviz 安装包
- python实现算术编码
- 围棋截屏图片扫描工具
- [python] Kmeans文本聚类算法+PAC降维+Ma
- mysqldb64位
- abaqus激光增材仿真,生死单元添加p
- 利用Python爬虫批量百度图库图片
- 基于python的深度信念网络
- win10下调用OpenCV-Python和YOLACT模型进行
- Python多线程子域名扫描自带字典
- modbus通信的Python实现
- python批量pdf转txt
- 遗传算法python代码
- 爬取京东评论。代码
- 迷宫问题的A*算法(python实现)
- Mod_Python2.7安装文件
- 王硕-你也能看懂的python算法书-随书代
- 使用Python实现的网络社团发现GN算法
- python3的ARP简单攻击脚本
- 详解python实现FP-TREE进行关联规则挖掘
评论
共有 条评论