SciTech-BigDataAIML-Tensorflow-Keras是用在Tensorflow的高層API

abaelhe發表於2024-05-08

[https://tensorflow.google.cn/guide/keras](Keras: The high-level API for TensorFlow)

https://tensorflow.google.cn/guide/keras

The core data structures of Keras are layers and models.

  • A layer is a simple input/output transformation,
  • and a model is a directed acyclic graph (DAG) of layers.

Layers

The tf.keras.layers.Layer class is the fundamental abstraction in Keras. A Layer encapsulates a state (weights) and some computation (defined in the tf.keras.layers.Layer.call method).

Weights created by layers can be trainable or non-trainable. Layers are recursively composable: If you assign a layer instance as an attribute of another layer, the outer layer will start tracking the weights created by the inner layer.

You can also use layers to handle data preprocessing tasks like normalization and text vectorization. Preprocessing layers can be included directly into a model, either during or after training, which makes the model portable.

Models

  • A model is an object that groups layers together and that can be trained on data.
  • The simplest type of model is the Sequential model, which is a linear stack of layers.

Data loading utilities
For a full list of available APIs, see the Keras API reference. To learn more about other Keras projects and initiatives, see The Keras ecosystem.

Next steps
To get started using Keras with TensorFlow, check out the following topics:

The Sequential model
The Functional API
Training & evaluation with the built-in methods
Making new layers and models via subclassing
Serialization and saving
Working with preprocessing layers
Customizing what happens in fit()
Writing a training loop from scratch
Working with RNNs
Understanding masking & padding
Writing your own callbacks
Transfer learning & fine-tuning
Multi-GPU and distributed training
To learn more about Keras, see the following topics at keras.io:

About Keras
Introduction to Keras for Engineers
Introduction to Keras for Researchers
Keras API reference
The Keras ecosystem
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licen

相關文章