文章分类 -  tensorflow

【tensorflow】05 -saver保存变量
摘要:保存 1 W = tf.Variable([[1,2,3],[3,4,5]],dtype=tf.float32,name="weights") #2行3列 2 b = tf.Variable([[1,2,3],dtype=tf.float32,name="biases") 3 #restore时,s 阅读全文
posted @ 2022-08-10 11:07 Jolyne123 阅读(28) 评论(0) 推荐(0)
【tensorflow】04-tensorboard可视化工具
摘要:1.name_scope和name配合使用如下面eg 2.后用SummaryWriter加载到logs文件里 1 writer = tf.train.SummaryWriter("logs/",sess.gragh) 2 #要在sess=tf.Session()后使用 3.cmd里cd到logs的根 阅读全文
posted @ 2022-08-10 11:06 Jolyne123 阅读(36) 评论(0) 推荐(0)
【tensorflow】03-activation function激励函数和add_layer添加层
摘要:定义add_layer添加层 1 def add_layer(inputs, in_size, activation_funcation=None): 2 Weights = tf.Variable(tf.random_normal([in_size, out_size])) 3 #Weights用 阅读全文
posted @ 2022-08-10 11:03 Jolyne123 阅读(54) 评论(0) 推荐(0)
【tensorflow】02-placeholder占位符
摘要:placeholder在执行时再传入值 数据 1 input1 = tf.placeholder(tf.float32) #input1 = tf.placeholder(tf.float32,[2,2])可定义格式 2 input2 = tf.placeholder(tf.float32) 方法 阅读全文
posted @ 2022-08-10 11:00 Jolyne123 阅读(60) 评论(0) 推荐(0)
【tensorflow】01-variable变量
摘要:变量增加例子 数据 1 state = tf.Variable(0,name='counter') #定义state的变量名字为counter,初始化为0 2 one = tf.constant(1) #one是常量1 方法 1 new_value = tf.add(state, one) #sta 阅读全文
posted @ 2022-08-10 10:59 Jolyne123 阅读(45) 评论(0) 推荐(0)
【tensorflow】00-session会话
摘要:session.run是运行session指针处代码 矩阵相乘例子 定义: 1 matrix1 = tf.constant([[3,3]]) 2 matrix2 = tf.constant([[2], 3 [2]]) 4 5 product = tf.matmul(matrix1,matrix2) 阅读全文
posted @ 2022-08-10 10:57 Jolyne123 阅读(20) 评论(0) 推荐(0)