标签:变量 nbsp controls one control multi ble pre 模型
学习参数的定义与输入的定义很像,分为直接定义和字典定义两种方法,如果参数过多的话,那么便会采用第二种定义。
直接定义:
1 W = tf.Variable(tf.random_normal([1]), name = "weight") 2 b = tf.Variable(tf.zeros([1]), name = "bias")
通过字典类型定义“学习参数”:
1 # 模型参数 2 paradict = { 3 ‘w‘: tf.Variable(tf.random_normal([1]), 4 ‘b‘: tf.Variable(tf.zeros([1])) 5 } 6 # 前向结构 7 z = tf.multiply(X, paradict[‘w‘]) + paradict[‘b‘]
标签:变量 nbsp controls one control multi ble pre 模型
原文地址:https://www.cnblogs.com/wqh2216/p/10453514.html