我在tensorflow中编写了k-means算法,并尝试在摘要中添加最小距离:
为什么地块的横向尺寸没有任何长度?横轴是什么? m
后缀是什么意思?
代码如下:
global_count = 0
count = 0
self.report.add_time_stamp(description="Initializing with k-means...")
self.report.add_time_stamp(description="#\tdist")
self.report.add_time_stamp(description="%d\t%.4e " % (count, dist_min_sum_value))
while dist_min_sum_value != dist_min_sum_value_old:
count += 1
global_count += 1
dist_min_sum_value_old = dist_min_sum_value
mu_value, cluster_indice_value, distance_square_value, dist_min_value, dist_min_sum_value = \
sess.run([self.mu_assign_new_kmeans, self.cluster_indices_assign_new_kmeans, self.distance_square,
self.dist_min, self.dist_min_sum])
if self.k_means_summary is not None:
k_means_summary_value = sess.run(self.k_means_summary)
self.k_means_writer.add_summary(k_means_summary_value, global_count - 1)
print("%d\t%.4e " % (count, dist_min_sum_value))
k_means_summary
定义看起来像
self.dist_min_sum_summary = tf.summary.scalar('dist_min_sum_summary', tf.squeeze(self.dist_min_sum))
...
self.k_means_summary = tf.summary.merge([self.dist_min_sum_summary])
合并单个摘要是否正确?
答案 0 :(得分:0)
似乎脚本可能只写1个事件。运行
的输出是什么tensorboard --inspect --logdir=[LOGDIR]
应输出所有事件类型的计数。格式(但不是数据)应如下所示:
audio -
graph -
histograms -
images -
scalars
first_step 0
last_step 42
max_step 42
min_step 0
num_steps 43
outoforder_steps []
sessionlog:checkpoint -
sessionlog:start -
sessionlog:stop -
tensor -