dense全連接層醋安,相當于添加一個層
tf.layers.dense(
inputs, # 輸入此網(wǎng)絡的數(shù)據(jù)
units, # 輸出維度大小,改變inputs的最后一維
activation=None, # 激活函數(shù)
use_bias=True, #是否使用偏置項
kernel_initializer=None, # 權重初始化if True initializer used by `tf.get_variable`.
bias_initializer=init_ops.zeros_initializer(), # 偏差初始化
kernel_regularizer=None, # 權重正則化
bias_regularizer=None, # 偏差正則化
activity_regularizer=None, # 輸出的正則化
kernel_constraint=None, #
bias_constraint=None,
trainable=True, # 該層是否參與訓練if `True` also add variables to the graph collection ‘GraphKeys.TRAINABLE_VARIABLES` (see `tf.Variable`).
name=None, # 該層的名字
reuse=None) # 是否重復使用參數(shù)
# outputs = activation(inputs * kernel + bias)
# `kernel` is a weights matrix created by the layer
# `bias` is a bias vector created by the layer (only if `use_bias` is `True`).