官术网_书友最值得收藏!

Updating the network

Now the deltas have been computed, it’s time to update the network’s parameters. In most cases, we use a type of gradient descent. Let  represent the learning rate, the parameter update formula is:

This is written in TensorFlow code as follows:

eta = tf.constant(0.01)
step = [
tf.assign(w_1,
tf.subtract(w_1, tf.multiply(eta, d_w_1))),
tf.assign(b_1,
tf.subtract(b_1, tf.multiply(eta,
tf.reduce_mean(d_b_1, axis=[0])))),
tf.assign(w_2,
tf.subtract(w_2, tf.multiply(eta, d_w_2))),
tf.assign(b_2,
tf.subtract(b_2, tf.multiply(eta,
tf.reduce_mean(d_b_2, axis=[0]))))
]
主站蜘蛛池模板: 班玛县| 交口县| 秦皇岛市| 同仁县| 乳山市| 望城县| 五华县| 凤庆县| 涟水县| 海伦市| 大城县| 龙陵县| 盐源县| 平邑县| 喀喇沁旗| 泾源县| 若羌县| 县级市| 长葛市| 海原县| 凤城市| 东莞市| 绥滨县| 金华市| 阆中市| 故城县| 临沂市| 呼伦贝尔市| 台中县| 达日县| 镇坪县| 南和县| 长春市| 辽中县| 宜阳县| 永川市| 革吉县| 元氏县| 亳州市| 三穗县| 盈江县|