I'm following the Tensorflow Get Started tutorial at https://www.tensorflow.org/get_started/get_started_for_beginners (I am new to Tensorflow, apologies for lack of knowledge).
I created the neural network as per the tutorial and it runs correctly, now I would like to print out the tensor values at every layer during training. Is there an easy way to do this?
Here is the code:
# Fetch the data
(train_x, train_y), (test_x, test_y) = iris_data.load_data()
# Feature columns describe how to use the input.
my_feature_columns = []
for key in train_x.keys():
my_feature_columns.append(tf.feature_column.numeric_column(key=key))
# Build 2 hidden layer DNN with 10, 10 units respectively.
classifier = tf.estimator.DNNClassifier(
feature_columns=my_feature_columns,
# Two hidden layers of 10 nodes each.
hidden_units=[10, 10],
# The model must choose between 3 classes.
n_classes=3)
# Train the Model.
classifier.train(
input_fn=lambda:iris_data.train_input_fn(train_x, train_y,
args.batch_size),
steps=args.train_steps)
# Evaluate the model.
....
Ideally, I would like to get the value of the hidden layers after every epoch. Any insight is greatly appreciated.