- Hands-On Artificial Intelligence for Beginners
- Patrick D. Smith
- 88字
- 2025-02-23 08:58:38
Basic building blocks
As Keras is designed as a model-level library, it does not contain methods for doing basic operations as PyTorch of base TensorFlow does. Instead, it utilizes TensorFlow as a backend. As such, its basic operations are the same as basic TensorFlow operations:
import keras.backend as K
x = K.constant(5)
y = K.constant(6)
product = x * y
Keras also uses the same graph structure as Tensorflow. We'll learn more about Keras model building methods in the next chapter on Your First Artificial Neural Networks.