- Deep Learning Essentials
- Wei Di Anurag Bhardwaj Jianing Wei
- 102字
- 2021-06-30 19:17:53
Forward propagation
Forward propagation is basically calculating the input data multiplied by the networks’ weight plus the offset, and then going through the activation function to the next layer:
An example code block using TensorFlow can be written as follows:
# dimension variables
dim_in = 2
dim_middle = 5
dim_out = 1
# declare network variables
a_0 = tf.placeholder(tf.float32, [None, dim_in])
y = tf.placeholder(tf.float32, [None, dim_out])
w_1 = tf.Variable(tf.random_normal([dim_in, dim_middle]))
b_1 = tf.Variable(tf.random_normal([dim_middle]))
w_2 = tf.Variable(tf.random_normal([dim_middle, dim_out]))
b_2 = tf.Variable(tf.random_normal([dim_out]))
# build the network structure
z_1 = tf.add(tf.matmul(a_0, w_1), b_1)
a_1 = sigmoid(z_1)
z_2 = tf.add(tf.matmul(a_1, w_2), b_2)
a_2 = sigmoid(z_2)
推薦閱讀
- 腦動力:Linux指令速查效率手冊
- MCSA Windows Server 2016 Certification Guide:Exam 70-741
- 21天學(xué)通C++
- 流處理器研究與設(shè)計
- 工業(yè)機器人現(xiàn)場編程(FANUC)
- 傳感器與物聯(lián)網(wǎng)技術(shù)
- 愛犯錯的智能體
- 面向?qū)ο蟪绦蛟O(shè)計綜合實踐
- Chef:Powerful Infrastructure Automation
- 激光選區(qū)熔化3D打印技術(shù)
- DevOps Bootcamp
- 計算機組成與操作系統(tǒng)
- Learning Linux Shell Scripting
- ADuC系列ARM器件應(yīng)用技術(shù)
- Raspberry Pi 3 Projects for Java Programmers