# -*- coding:UTF-8 -*-
"""
Please note, this code is only for python 3+. If you are using python 2+, please modify the code accordingly.
"""
import tensorflow as tf
import numpy as np
def add_layer(inputs, in_size, out_size, n_layer, activation_function=None):
# add one more layer and return the output of this layer
layer_name = 'layer%s' % n_layer
with tf.name_scope(layer_name):
with tf.name_scope('weights'):
Weights = tf.Variable(tf.random_normal([in_size, out_size]), name='W')
tf.summary.histogram(layer_name + '/weights', Weights)
with tf.name_scope('biases'):
biases = tf.Variable(tf.zeros([1, out_size]) + 0.1, name='b')
tf.summary.histogram(layer_name + '/biases', biases)
with tf.name_scope('Wx_plus_b'):
Wx_p
Tensorboard 可视化(二)画训练过程
最新推荐文章于 2023-06-24 23:20:09 发布
本文深入探讨如何使用 Tensorboard 进行深度学习训练过程的可视化,包括损失曲线、学习率变化等关键指标的展示,帮助优化模型性能。
摘要由CSDN通过智能技术生成