上一篇文章,比较了三种算法实现对手写数字识别,其中,SVM和神经网络算法表现非常好准确率都在90%以上,本文章进一步探讨对神经网络算法优化,进一步提高准确率,通过测试发现,准确率提高了很多. 首先,改变之一: 先在初始化权重的部分,采取一种更为好的随机初始化方法,我们依旧保持正态分布的均值不变,只对标准差进行改动, 初始化权重改变前, def large_weight_initializer(self): self.biases = [np.random.randn(y, 1) for y in
这是一个来自官网的示例:https://github.com/keras-team/keras/blob/master/examples/antirectifier.py 与之前的MINST手写数字识别全连接网络相比,只是本实例使用antirectifier替换ReLU激活函数. '''The example demonstrates how to write custom layers for Keras. # Keras自定义层编写示范 We build a custom activatio