theano-xnor-net
一呆飞仙
你那么努力,一定能活到大结局!
展开
-
theano-xnor-net代码注释 cifar10_train.py
# *_*coding:utf-8 *_*import sys, os, timeimport lasagneimport numpy as npimport theanoimport theano.tensor as Timport cPickleimport xnor_netimport cnn_utilsfrom external import bnn_utilsimport原创 2017-06-20 10:27:12 · 1667 阅读 · 5 评论 -
theano-xnor-net代码注释2 cnn_utils.py
import numpy as npimport cPickleimport cv2from pylearn2.datasets.mnist import MNISTfrom pylearn2.datasets.cifar10 import CIFAR10from pylearn2.datasets.svhn import SVHN_DATASET_SIZE = {'mnist' : 50原创 2017-06-20 10:30:40 · 1109 阅读 · 0 评论 -
theano-xnor-net代码注释3 xnor_net.py
# *_*coding:utf-8 *_*""" Class and method definition for the layers in XNOR-Net(用于构建神经网络各层的类和函数)"""import theanoimport theano.tensor.nnetimport numpy as npimport lasagneimport theano.tensor as T原创 2017-06-20 10:32:45 · 965 阅读 · 0 评论 -
theano-xnor-net代码注释4 bnn_utils.py
# This code is taken from the BinaryNet implementation by Matthieu Courbariaux# The original code can be found here https://github.com/MatthieuCourbariaux/BinaryNet# The LICENSE for this piece of cod原创 2017-06-20 10:34:23 · 1642 阅读 · 4 评论 -
theano-xnor-net代码注释5 cifar10_test.py
import sys, os, timeimport argparseimport lasagneimport numpy as npimport theanoimport theano.tensor as Timport cPickle, timeimport inf_layersfrom fxp_helper import convert_fxp_format, fixed_po原创 2017-06-20 10:38:20 · 756 阅读 · 0 评论 -
theano-xnor-net代码注释6 fxp_helper.py
import numpy as npimport theanoimport theano.tensor as Timport math#to_fixed_point_theano函数就是设定一个阈值,即max=data_bits能表达最大的无符号整数,阈值为[-max,max],中间还存在一些扩大与近似操作#最后的目的就是加速收敛def to_fixed_point_theano(inp原创 2017-06-20 10:39:43 · 366 阅读 · 0 评论 -
theano-xnor-net代码注释7 inf_layers.py
import theanoimport theano.tensor as Timport numpy as npimport lasagnefrom fxp_helper import to_fixed_point_theano# Classic batch normalization layer with fixed point simulation feature for the out原创 2017-06-20 10:41:21 · 533 阅读 · 0 评论 -
theano-xnor-net代码注释8 xnornet_layers.py
""" Class and method definition for the layers in XNOR-Net"""import theanoimport theano.tensor.nnetimport numpy as npimport lasagneimport theano.tensor as Timport timefrom fxp_helper import to_原创 2017-06-20 10:43:05 · 871 阅读 · 0 评论 -
theano-xnor-net代码注释9 pylearn2/cifar10.py
""".. todo:: WRITEME"""import osimport loggingimport numpyfrom theano.compat.six.moves import xrangefrom pylearn2.datasets import cache, dense_design_matrixfrom pylearn2.expr.preprocessing imp原创 2017-06-20 10:48:27 · 958 阅读 · 0 评论