Definition: Multidimensional arrays representing data.
Key Properties:
shape
: Dimensions of the tensor.dtype
: Data type of elements (e.g.,tf.float32
,tf.int32
).rank
: Number of dimensions.
A quick reference guide to TensorFlow, covering its core concepts, common operations, and essential functions for building and training machine learning models.
Definition: Multidimensional arrays representing data. Key Properties:
|
Creating Tensors:
|
Tensor Operations:
|
Definition: Tensors that can be modified during computation. Used to store model parameters. Initialization:
|
Updating Variables:
|
Note: This section refers to TensorFlow 1.x. TensorFlow 2.x uses eager execution by default. Graph: A computational graph representing the model structure.
|
Definition: Building blocks of neural networks. Perform specific computations on input tensors. Common Layers:
|
Example:
|
Sequential Model: A linear stack of layers.
Functional API: More flexible way to define complex models with shared layers and multiple inputs/outputs.
|
Definition: Measures the difference between predicted and actual values. Common Loss Functions:
|
Definition: Algorithms for updating model parameters to minimize the loss function. Common Optimizers:
|
Purpose: Configures the model for training.
|
Purpose: Trains the model using the training data.
|
Purpose: Evaluates the model’s performance on the test data.
|
Purpose: Generates predictions on new data.
|
Purpose: Persists the trained model to disk.
|
Purpose: Restores a saved model from disk.
|
Purpose: Automate tasks during training (e.g., saving checkpoints, stopping early). Common Callbacks:
|