Model Initialization
Understand how to initialize placeholders for inputs and labels when building an MLP model with TensorFlow. This lesson covers setting data types, shapes including flexible batch sizes, and naming conventions to prepare your model for training with variable-sized datasets.
We'll cover the following...
We'll cover the following...
Chapter Goals:
- Define a class for an MLP model
- Initialize the model
A. Placeholder
When building the computation graph of our model, tf.compat.v1.placeholder acts as a "placeholder" for the input data and labels. Without the tf.compat.v1.placeholder, we would not be able to train our model on real input data.
A tf.compat.v1.placeholder takes in a required first argument and two keyword arguments called shape and name.
The required argument for the placeholder is its type. ...