取得摘要
tflearn.summaries.get_summary (stype, tag, value=None, collection_key=None, break_if_exists=False)
建立或檢索摘要。它會追蹤 summary_tags 彙總中的所有圖表摘要。如果摘要標籤已存在,則會傳回該摘要張量或擲回例外錯誤 (根據 'break_if_exists')。
引數
- stype:
字串
。摘要類型:'histogram'、'scalar' 或 'image'。 - 標籤:
字串
。摘要標籤 (名稱)。 - value:
張量
。摘要初始化值。預設:無。 - collection_key:
字串
。如果已指定,建立的摘要將會加入到那個彙總中 (選用)。 - break_if_exists:
布林值
。如果設為 True,如果已有相同標籤的摘要,則會擲回例外錯誤 (而不是傳回那個現有的摘要)。
傳回
摘要張量
。
新增啟動值摘要
tflearn.summaries.add_activations_summary (activation_ops, name_prefix='', name_suffix='', collection_key=None)
為給定的啟動值新增直方圖摘要。
引數
- activation_ops:
張量
清單。要摘要的啟動值。 - name_prefix:
字串
。要新增到摘要範圍的前置詞。 - name_suffix:
字串
。要新增到摘要範圍的後置詞。 - collection_key:
字串
。要儲存摘要的彙總。
傳回
建立的啟動值摘要清單。
新增梯度摘要
tflearn.summaries.add_gradients_summary (grads, name_prefix='', name_suffix='', collection_key=None)
為給定的梯度新增直方圖摘要。
引數
- grads:
張量
清單。要摘要的梯度。 - name_prefix:
字串
。要新增到摘要範圍的前置詞。 - name_suffix:
字串
。要新增到摘要範圍的後置詞。 - collection_key:
字串
。要儲存摘要的彙總。
傳回
建立的梯度摘要清單。
新增可訓練變數摘要
tflearn.summaries.add_trainable_vars_summary (variables, name_prefix='', name_suffix='', collection_key=None)
為給定的變數權重新增直方圖摘要。
引數
- variables:
變數
清單。要摘要的變數。 - name_prefix:
字串
。要新增到摘要範圍的前置詞。 - name_suffix:
字串
。要新增到摘要範圍的後置詞。 - collection_key:
字串
。要儲存摘要的彙總。
傳回
建立的權重摘要清單。
從摘要字串取得值
tflearn.summaries.get_value_from_summary_string (tag, summary_str)
從摘要字串中擷取摘要值。
引數
- 標籤:
字串
。摘要標籤 (名稱)。 - summary_str:
str
。要查詢的摘要字串。
傳回
float
。擷取的值。
新增損失摘要
tflearn.summaries.add_loss_summaries (total_loss, loss, regul_losses_collection_key, name_prefix='', summaries_collection_key=None, exp_moving_avg=0.9, ema_num_updates=None)
針對特定損失添加標量摘要 (原始及平均值)。
產生所有損失的移動平均,以及相關的摘要以視覺化網路的執行效能。
引數
- total_loss:
Tensor
。總損失 (回歸損失 + 正則化損失)。 - loss:
Tensor
。回歸損失。 - name_prefix:
str
。要新增到摘要名稱的前綴。 - regul_losses_collection_key:
str
。擷取正則化損失的集合名稱。 - exp_moving_avg:
float
。指數移動平均值。 - ema_num_updates:
int
。要與指數移動平均值搭配使用的步驟數。
傳回
loss_averages_op: 產生損失移動平均值的運算式。
摘要已存在
tflearn.summaries.summary_exists (tag)
檢查摘要是否存在。
引數
- tag:
str
。摘要名稱。
傳回
bool
。摘要是否存在。