Sequential 函数是一个容器,描述了神经网络的网络结构,在Sequential函数的输入参数中描述从输入层到输出层的网络结构
。
例如
model=tf.keras.Sequential(layers=[tf.keras.layers.Dense(3,activation="relu"), tf.keras.layers.Dense(3,activation="softmax")])
常用的层有:
其中activation(字符串给出)可选 relu、softmax、sigmoid、tanh等
kernel_regularizer 可选 tf.keras.regularizers.l1()、 tf.keras.regularizers.l2()