on 01-May-2024 (Wed)

Flashcard 7624635845900

Tags
#conv2D #convolution #tensorflow #tensorflow-certificate
Question
Step 1 is to gather the data. You'll notice that there's a bit of a change here in that the training data needed to be reshaped. That's because the first convolution expects a single tensor containing everything, so instead of 60,000 28x28x1 items in a list, we have a single 4D list that is [...size?],
60,000x28x28x1

status measured difficulty not learned 37% [default] 0

Parent (intermediate) annotation

Open it
ng data needed to be reshaped. That's because the first convolution expects a single tensor containing everything, so instead of 60,000 28x28x1 items in a list, we have a single 4D list that is <span>60,000x28x28x1, <span>

Original toplevel document

Convolution Neural Network - introduction
Step 1 is to gather the data. You'll notice that there's a bit of a change here in that the training data needed to be reshaped. That's because the first convolution expects a single tensor containing everything, so instead of 60,000 28x28x1 items in a list, we have a single 4D list that is 60,000x28x28x1, and the same for the test images. If you don't do this, you'll get an error when training as the Convolutions do not recognize the shape. import tensorflow as tf mnist = tf.keras.datase

Flashcard 7625839086860

Tags
#tensorflow #tensorflow-certificate
Question

import tensorflow as tf

#stop training after reaching accuract of 0.99
class MyCallback(tf.keras.callbacks.Callback):
def on_epoch_end(self, epoch, logs={}):
if logs.get('accuracy')>=0.99:
print('\nAccuracy 0.99 achieved')
self.model.stop_training = [...]

True

status measured difficulty not learned 37% [default] 0

Tensorflow - callbacks
act of 0.99 class MyCallback(tf.keras.callbacks.Callback): def on_epoch_end(self, epoch, logs={}): if logs.get('accuracy')>=0.99: print('\nAccuracy 0.99 achieved') self.model.stop_training = <span>True <span>

Flashcard 7625841184012

Tags
#tensorflow #tensorflow-certificate
Question
# global seed
tf.random.set_seed(42)

#operation seed
tf.random.[...](not_shuffled, seed=42)

shuffle

status measured difficulty not learned 37% [default] 0

Tensorflow random
# global seed tf.random.set_seed(42) #operation seed tf.random.shuffle(not_shuffled, seed=42)

Flashcard 7625843019020

Tags
#tensorflow #tensorflow-certificate
Question

another_matrix = tf.constant([[10. ,66.],
[5. , 9.],
[13. , 4.]], dtype=[...])
another_matrix

Out:
<tf.Tensor: shape=(3, 2), dtype=float16, numpy=
array([[10., 66.],
[ 5.,  9.],
[13.,  4.]], dtype=float16)>

tf.float16

status measured difficulty not learned 37% [default] 0

Tensorflow fundamentals
another_matrix = tf.constant([[10. ,66.], [5. , 9.], [13. , 4.]], dtype=tf.float16) another_matrix Out: <tf.Tensor: shape=(3, 2), dtype=float16, numpy= array([[10., 66.], [ 5., 9.], [13., 4.]], dtype=float16)>

Flashcard 7625844854028

Tags
#tensorflow #tensorflow-certificate
Question
#### Def some functions to calculate losses (mae, mse)

def evaluate_mae(y_true, y_pred):
return tf.keras.losses.mean_absolute_error(y_true = y_true,
y_pred = [...](y_pred))