资源简介
google-tensorflow官方样例,简单的BP神经网络解决mnist问题.
代码片段和文件信息
“““ Neural Network.
A 2-Hidden layers Fully Connected Neural Network (a.k.a Multilayer Perceptron)
implementation with TensorFlow. This example is using the MNIST database
of handwritten digits (http://yann.lecun.com/exdb/mnist/).
links:
[MNIST Dataset](http://yann.lecun.com/exdb/mnist/).
Author: Aymeric Damien
Project: https://github.com/aymericdamien/TensorFlow-Examples/
“““
from __future__ import print_function
# Import MNIST data
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets(“/tmp/data/“ one_hot=True)
import tensorflow as tf
# Parameters
learning_rate = 0.1
num_steps = 500
batch_size = 128
display_step = 100
# Network Parameters
n_hidden_1 = 256 # 1st layer number of neurons
n_hidden_2 = 256 # 2nd layer number of neurons
num_input = 784 # MNIST data input (img shape: 28*28)
num_classes = 10 # MNIST total classes (0-9 digits)
# tf Graph input
X = tf.placeholder(“float“ [None num_input])
Y = tf.placeholder(“float“ [None num_classes])
# Store layers weight & bias
weights = {
‘h1‘: tf.Variable(tf.random_normal([num_input n_hidden_1]))
‘h2‘: tf.Variable(tf.random_normal([n_hidden_1 n_hidden_2]))
‘out‘: tf.Variable(tf.random_normal([n_hidden_2 num_classes]))
}
biases = {
‘b1‘: tf.Variable(tf.random_normal([n_hidden_1]))
‘b2‘: tf.Variable(tf.random_normal([n_hidden_2]))
‘out‘: tf.Variable(tf.random_normal([num_classes]))
}
# Create model
def neural_net(x):
# Hidden fully connected layer with 256 neurons
layer_1 = tf.add(tf.matmul(x weights[‘h1‘]) biases[‘b1‘])
# Hidden fully connected layer with 256 neurons
layer_2 = tf.add(tf.matmul(layer_1 weights[‘
相关资源
- 卷积神经网络图像识别python代码pdf
- 卷积神经网络python
- Python-subpixel利用Tensorflow的一个子像素
- Python-神经网络模型能够从音频演讲中
- OCR:一个有趣的网页版手写数字识别
- NeMo_脉冲神经网络工具_spiking neural n
- 使用python自己实现神经网络操纵赛车
- 基于递归神经网络的广告点击率预估
- 卷积神经网络的Python实现【试读】1
- Make Your Own Neural Network - 搭建自己的神
- 利用脉冲耦合神经网络的图像处理.
- Python神经网络编程高清,带详细书签
- Python神经网络编程.zip
- python不使用框架实现卷积神经网络识
- CNN卷积神经网络PYTHON
- python实现的卷积神经网络CNN无框架
- 卷积神经网络图像识别python代码
- 卷积神经网络的Python实现 -《卷积神经
- 作业一_BP_SVM_RBF函数拟合.7z
- Michael Nielsen 的《Neural Networks and Deep
- 《Python神经网络编程》中文版PDF+英文
- 脉冲神经网络Python可运行
- matlab和python的神经网络
- 基于卷积神经网络的人脸识别
- 基于卷积神经网络的手势识别
- CNN用于图像分类以外的数字序列.rar
- 基于卷积神经网络的猫种类识别
- 神经网络与深度学习-Neural Network and
- 卷积神经网络的Python实现
- 卷积神经网络预测
评论
共有 条评论