Tensorflow Manage Experiments
来源:互联网 发布:2016国内旅游数据 编辑:程序博客网 时间:2024/06/05 02:21
1. Visualize graphs with TensorBoard
# define model# launch a session to compute the graphwith tf.Session() as sess: writer = tf.summary.FileWriter("./graphs", sess.graph) # for step in range(training_steps): sess.run([optimizer])# Go to terminal, run:# $ python [yourprogram].py# $ tensorboard --logdir="./graphs" --port 6006# Then open your browser and go to: http://localhost:6006/
2. Saving and Restoring Variables
# checkpointglobal_step = tf.Variable(0, dtype=tf.int32, trainable=False, name="global_step") # train_step = tf.train.AdamOptimizer(1e-4).minimize(cross_entropy, global_step = global_step) # # define model# launch a session to compute the graphsaver = tf.train.Saver() # with tf.Session() as sess: for step in range(training_steps): sess.run([train_op]) if (i + 1)% 300 == 0: # saver.save(sess, './checkpoints/ckpt', global_step=global_step) #
# define model# launch a session to compute the graphwith tf.Session() as sess: ckpt = tf.train.get_checkpoint_state(os.path.dirname('./checkpoints/ckpt')) # if ckpt and ckpt.model_checkpoint_path: # saver.restore(sess, ckpt.model_checkpoint_path) # for step in range(training_steps): sess.run([optimizer])
3. Visualize our summary statistics during our training
# define modelwith tf.name_scope("summaries"): # tf.summary.image('input', x_image, 4) # tf.summary.scalar("accuracy", accuracy) # tf.summary.histogram("loss", cross_entropy)# summary_op = tf.summary.merge_all() # # launch a session to compute the graphwith tf.Session() as sess: writer = tf.summary.FileWriter("./graphs", sess.graph) # for step in range(training_steps): sess.run([train_op]) summary = sess.run(summary_op, feed_dict={x: batch[0], y_: batch[1], keep_prob: 0.5}) # writer.add_summary(summary, global_step = i) #
阅读全文
0 0
- Tensorflow Manage Experiments
- doing experiments
- Gaussian Blur Experiments
- Probability Through Experiments
- Probability Through Experiments
- Probability Through Experiments
- AIZU 0024 Physical Experiments
- Multi-armed Bandit Experiments
- WebRTC Experiments & Demos
- TransH论文:Experiments-Link prediction
- kk manage
- Project Manage
- Manage Notes
- Code Manage
- user manage
- Manage images
- AVD Manage
- enterprise manage
- Activtiy使用与理解
- 单例模式的写法
- python之第三方库安装方法pip(pip如何设置代理安装库)
- 项目笔记(二)
- MyFragment
- Tensorflow Manage Experiments
- A
- C语言的一些知识点
- vs2010+opencv3.0.0 环境配置 (以及配置技巧)
- POJ2749 Building roads【2-SAT】
- HDU 1179 Ollivanders: Makers of Fine Wands since 382 BC.(二分图匹配+匈牙利算法)
- hdu6127Hard challenge(极角排序)
- OSG 事件处理机制 类图
- java集合2