神经网络
夕下等花wz
既然选择远方,便只顾风雨兼程!
展开
-
神经网络(tensorflow)(1)
import tensorflow as tfimport numpy as np#create datax_data = np.random.rand(100).astype(np.float32)#在tensorflow中大部分的数据的数据类型都是float32y_data = x_data * 0.1+0.3#create tensorflow structure start...原创 2019-07-18 09:54:26 · 100 阅读 · 0 评论 -
tensorflow之Session
#Session会话控制#session执行命令,会话控制import tensorflow as tfmatrix1 = tf.constant([[3, 3]])matrix2 = tf.constant([[2], [2]])product = tf.matmul(matrix1, matrix2)#矩阵的乘法,在numpy中,矩阵...原创 2019-07-18 10:15:01 · 120 阅读 · 0 评论 -
tensorflow之Variable变量
import tensorflow as tfstate = tf.Variable(0, name='counter')#print(state.name)one = tf.constant(1)new_value = tf.add(state, one)update = tf.assign(state, new_value)#将new_value的值加载到state上#必须要...原创 2019-07-18 10:27:04 · 149 阅读 · 0 评论 -
tensorflow之placeholder传入值
import tensorflow as tfinput1 = tf.placeholder(tf.float32)input2 = tf.placeholder(tf.float32)output = tf.multiply(input1, input2)with tf.Session() as sess: print(sess.run(output, feed_dict...原创 2019-07-18 10:40:07 · 172 阅读 · 0 评论