2種和batch有關的函式解析

2021-09-11 20:34:04 字數 1582 閱讀 3176

tensor_list: the list of tensors to enqueue.

入隊的張量列表

batch_size: the new batch size pulled from the queue.

表示進行一次批處理的tensors數量.

capacity: an integer. the maximum number of elements in the queue.

容量:乙個整數,佇列中的最大的元素數.

這個引數一定要比min_after_dequeue引數的值大,並且決定了我們可以進行預處理操作元素的最大值.

推薦其值為:

capacity=(min_after_dequeue+(num_threads+a small safety margin∗batchsize)

min_after_dequeue: minimum number elements in the queue after a

dequeue(出列), used to ensure a level of mixing of elements.

當一次出列操作完成後,佇列中元素的最小數量,往往用於定義元素的混合級別.

定義了隨機取樣的緩衝區大小,此引數越大表示更大級別的混合但是會導致啟動更加緩慢,並且會占用更多的記憶體

tf.train.string_input_producer(

string_tensor,

num_epochs=none,

shuffle=true,

seed=none,

capacity=32,

shared_name=none,

name=none,

cancel_op=none

)filename_queue = tf.train.string_input_producer(filename, shuffle=false, num_epochs=5)

string_input_producer會產生乙個檔名佇列

filename檔名,可以將多個檔名相加,或者是輸入乙個檔名,不限定是

如:filename = [『a.jpg』, 『b.jpg』, 『c.jpg』]

shuffle是指在乙個epoch內檔案的順序是否被打亂。

如果設定shuffle=true,那麼在乙個epoch內,資料的前後順序就會被打亂

num_epochs

epoch。對於乙個資料集來講,執行乙個epoch就是將這個資料集中的全部計算一遍。如乙個資料集中有三張a.jpg、b.jpg、c.jpg,那麼跑乙個epoch就是指對a、b、c三張都計算了一遍。兩個epoch就是指先對a、b、c各計算一遍,然後再全部計算一遍,也就是說每張都計算了兩遍。

tf.train.shuffle_batch函式解析

十圖詳解tensorflow資料讀取機制(附**)

DB2中有關日期和時間的函式

db2中有關日期和時間的函式,及應用 dayname 返回乙個大小寫混合的字串,對於引數的日部分,用星期表示這一天的名 稱 例如,friday dayofweek 返回引數中的星期幾,用範圍在 1 7 的整數值表示,其中 1 代表星期日。dayofweek iso 返回引數中的星期幾,用範圍在 1 ...

詳細解析幾個和網路請求有關的類

詳細解析幾個和網路請求有關的類 一 nsurlsession 詳細解析幾個和網路請求有關的類 二 nsurlrequest和nsmutableurlrequest 詳細解析幾個和網路請求有關的類 三 nsurlconnection 詳細解析幾個和網路請求有關的類 四 nsurlsession和nsu...

Unix 下dup和dup2函式的解析

函式原型 include int dup int filedes int dup2 int filedes,int filedes2 apue上說dup返回最小的可用檔案描述符 最小的尚未開啟的檔案 對於dup2,我們指定新的檔案描述符引數為filedes2。如果filedes2已經開啟,那麼它將先...