官方的接口是這樣的
tf.nn.dropout(x, keep_prob, noise_shape=None, seed=None, name=None)
根據給出的keep_prob參數,將輸入tensor x按比例輸出。
默認情況下, 每個元素保存或丟棄都是獨立的。后面這段沒太懂,以后懂了再補上: If noise_shape is specified, it must be broadcastable to the shape of x, and only dimensions with noise_shape[i] == shape(x)[i] will make independent decisions. For example, if shape(x) = [k, l, m, n] and noise_shape = [k, 1, 1, n], each batch and channel component will be kept independently and each row and column will be kept or not kept together.
x : 輸入tensor
keep_prob : float類型,每個元素被保留下來的概率
noise_shape : 一個1維的int32張量,代表了隨機產生“保留/丟棄”標志的shape。
seed : 整形變量,隨機數種子。
name : 名字,沒啥用。