首页 > 其他 > 详细

Tensorflow Keras tutotrials01

时间:2021-02-24 23:29:35      阅读:25      评论:0      收藏:0      [点我收藏+]

tf.keras.Sequential

groups a linear stack Models into Sequential

Here are  quick starts for the beginners and experts respectively: MINIST Recongnization

So, the key point of the programming is about how to build the Model. Here, we build tf.keras model using subclass tf.keras.Sequential.

Then,we talk about how to use Sequential model:

 

Sequential model is appropriate for a plain stack of layers where each layer has exactly one input tensor and one output tensor.

Schematically, the following Sequential model:

# Define Sequential model with 3 layers
model = keras.Sequential(
    [
        layers.Dense(2, activation="relu", name="layer1"),
        layers.Dense(3, activation="relu", name="layer2"),
        layers.Dense(4, name="layer3"),
    ]
)
# Call model on a test input
x = tf.ones((3, 3))
y = model(x)

Dense implements the operation: output = activation(dot(input, kernel) + bias) where activation is the element-wise activation function passed as the activation argument, kernel is a weights matrix created by the layer, and bias is a bias vector created by the layer (only applicable if use_bias is True).

 

Tensorflow Keras tutotrials01

原文:https://www.cnblogs.com/yuelien/p/14443154.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!