分享

使用TensorFlow实现MLP(多层感知机)

Oner 2018-3-26 21:06:21 发表于 功能源码 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 0 6189
本帖最后由 Oner 于 2018-3-26 21:30 编辑
功能点

TensorFlow实现MLP(多层感知机)

运行环境

Python 2.7
Jupyter Notebook 4.3.0

代码预览

[mw_shl_code=python,true]import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data

# one_hot=True 目的是将 label 进行 one-hot 编码
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
sess = tf.Session()

in_units = 784
h1_units = 300

W1 =  tf.Variable(tf.truncated_normal([in_units, h1_units], stddev=0.1))
b1 = tf.Variable(tf.zeros([h1_units]))

W2 = tf.Variable(tf.zeros([h1_units, 10]))
b2 = tf.Variable(tf.zeros([10]))[/mw_shl_code]

代码下载

02. MLP(Multilayer Perceptron).zip (2.76 KB, 下载次数: 3)

没找到任何评论,期待你打破沉寂

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条