TensorFlow tf.keras.layers.Dense

参数

参数 描述
units 输出的维度
activation 激活函数,默认"linear"
use_bias
kernel_initializer
bias_initializer
kernel_regularizer
bias_regularizer
activity_regularizer
kernel_constraint
bias_constraint

输入形状

2维张量:(batch_size, input_dim)
n维张量:(batch_size, …, input_dim)

输出形状

2维张量:(batch_size,units)
n维张量:(batch_size, …, units)

init

__init__(
    units,
    activation=None,
    use_bias=True,
    kernel_initializer='glorot_uniform',
    bias_initializer='zeros',
    kernel_regularizer=None,
    bias_regularizer=None,
    activity_regularizer=None,
    kernel_constraint=None,
    bias_constraint=None,
    **kwargs
)

参考:
https://tensorflow.google.cn/versions/r2.0/api_docs/python/tf/keras/layers/Dense

上一篇:【C++ Primer 第五版】类简介


下一篇:VMware虚拟机装系统出现Units specified dont exist解决办法