# on 13-Apr-2024 (Sat)

#### Flashcard 7624064896268

Tags
#tensorflow #tensorflow-certificate
Question

from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense
import numpy as np

model = [...](Dense(1, input_shape=[1]))
model.compile(optimizer='sgd', loss='mean_squared_error')
xs = np.array([1,5,12,-1,10], dtype=float)
ys = np.array([5,13,27,1,23], dtype=float)
model.fit(xs, ys, epochs=500)
model.predict(x=[15])

Sequential

status measured difficulty not learned 37% [default] 0

Tensorflow basics - typical flow of model building
from tensorflow.keras import Sequential from tensorflow.keras.layers import Dense import numpy as np model = Sequential(Dense(1, input_shape=[1])) model.compile(optimizer='sgd', loss='mean_squared_error') xs = np.array([1,5,12,-1,10], dtype=float) ys = np.array([5,13,27,1,23], dtype=float) model.fit(xs,

#### Annotation 7624228736268

 Tensors fundamentals - creating tensors #tensorflow #tensorflow-certificate # Create matrix another_matrix = tf.constant([[10. ,66.], [5. , 9.], [13. , 4.]], dtype=tf.float16) another_matrix another_matrix.ndim 2

#### Flashcard 7624230571276

Tags
#tensorflow #tensorflow-certificate
Question
# Create matrix
another_matrix = tf.constant([[10. ,66.],
[5. , 9.],
[13. , 4.]], dtype=tf.float16)
another_matrix

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

another_matrix.[...]
2

ndim

status measured difficulty not learned 37% [default] 0

Tensors fundamentals - creating tensors
0. ,66.], [5. , 9.], [13. , 4.]], dtype=tf.float16) another_matrix <tf.Tensor: shape=(3, 2), dtype=float16, numpy= array([[10., 66.], [ 5., 9.], [13., 4.]], dtype=float16)> another_matrix.<span>ndim 2 <span>

#### Flashcard 7624232144140

Tags
#tensorflow #tensorflow-certificate
Question
# Create matrix
another_matrix = tf.constant([[10. ,66.],
[5. , 9.],
[13. , 4.]], dtype=tf.float16)
another_matrix

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

another_matrix.ndim
2

(3, 2)

status measured difficulty not learned 37% [default] 0

Tensors fundamentals - creating tensors
# Create matrix another_matrix = tf.constant([[10. ,66.], [5. , 9.], [13. , 4.]], dtype=tf.float16) another_matrix <tf.Tensor: shape=(3, 2), dtype=float16, numpy= array([[10., 66.], [ 5., 9.], [13., 4.]], dtype=float16)> another_matrix.ndim 2

#### Flashcard 7624233192716

Tags
#tensorflow #tensorflow-certificate
Question
# Create matrix
another_matrix = tf.constant([[10. ,66.],
[5. , 9.],
[13. , 4.]], dtype=[...])
another_matrix

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

another_matrix.ndim
2

tf.float16

status measured difficulty not learned 37% [default] 0

Tensors fundamentals - creating tensors
# Create matrix another_matrix = tf.constant([[10. ,66.], [5. , 9.], [13. , 4.]], dtype=tf.float16) another_matrix <tf.Tensor: shape=(3, 2), dtype=float16, numpy= array([[10., 66.], [ 5., 9.], [13., 4.]], dtype=float16)> another_matrix.ndim 2

#### Flashcard 7624234241292

Tags
#tensorflow #tensorflow-certificate
Question
# Create matrix
another_matrix = tf.constant([[10. ,66.],
[5. , 9.],
[13. , 4.]], dtype=tf.float16)
another_matrix

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

another_matrix.ndim
2

Tensor

status measured difficulty not learned 37% [default] 0

Tensors fundamentals - creating tensors
# Create matrix another_matrix = tf.constant([[10. ,66.], [5. , 9.], [13. , 4.]], dtype=tf.float16) another_matrix <tf.Tensor: shape=(3, 2), dtype=float16, numpy= array([[10., 66.], [ 5., 9.], [13., 4.]], dtype=float16)> another_matrix.ndim 2

#### Flashcard 7624235289868

Tags
#tensorflow #tensorflow-certificate
Question
# Create matrix
another_matrix = tf.[...]([[10. ,66.],
[5. , 9.],
[13. , 4.]], dtype=tf.float16)
another_matrix

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

another_matrix.ndim
2

constant

status measured difficulty not learned 37% [default] 0

Tensors fundamentals - creating tensors
# Create matrix another_matrix = tf.constant([[10. ,66.], [5. , 9.], [13. , 4.]], dtype=tf.float16) another_matrix <tf.Tensor: shape=(3, 2), dtype=float16, numpy= array([[10., 66.], [ 5., 9.], [13., 4.]], dtype=float16)> ano

#### Flashcard 7624236338444

Tags
#tensorflow #tensorflow-certificate
Question
# Create matrix
another_matrix = tf.constant([[10. ,66.],
[5. , 9.],
[13. , 4.]], dtype=tf.float16)
another_matrix

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

another_matrix.ndim
2

shape

status measured difficulty not learned 37% [default] 0

Tensors fundamentals - creating tensors
# Create matrix another_matrix = tf.constant([[10. ,66.], [5. , 9.], [13. , 4.]], dtype=tf.float16) another_matrix <tf.Tensor: shape=(3, 2), dtype=float16, numpy= array([[10., 66.], [ 5., 9.], [13., 4.]], dtype=float16)> another_matrix.ndim 2

#### Flashcard 7624237387020

Tags
#tensorflow #tensorflow-certificate
Question
# Create matrix
another_matrix = tf.constant([[10. ,66.],
[5. , 9.],
[13. , 4.]], [...]=tf.float16)
another_matrix

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

another_matrix.ndim
2

dtype

status measured difficulty not learned 37% [default] 0

Tensors fundamentals - creating tensors
# Create matrix another_matrix = tf.constant([[10. ,66.], [5. , 9.], [13. , 4.]], dtype=tf.float16) another_matrix <tf.Tensor: shape=(3, 2), dtype=float16, numpy= array([[10., 66.], [ 5., 9.], [13., 4.]], dtype=float16)> another_matrix.ndim 2

#### Annotation 7624246562060

 Tensorflow basics #tensorflow #tensorflow-certificate changeable_tensor = tf.Variable([10, 7]) changeable_tensor[0] = 77 Output: TypeError: 'ResourceVariable' object does not support item assignment changeable_tensor[0].assign(77) Output: 

#### Flashcard 7624248397068

Tags
#tensorflow #tensorflow-certificate
Question
changeable_tensor = tf.[...]([10, 7])

changeable_tensor[0] = 77

Output:
TypeError: 'ResourceVariable' object does not support item assignment

changeable_tensor[0].assign(77)

>

Variable

status measured difficulty not learned 37% [default] 0

Tensorflow basics
changeable_tensor = tf.Variable([10, 7]) changeable_tensor[0] = 77 Output: TypeError: 'ResourceVariable' object does not support item assignment changeable_tensor[0].assign(77) Output: <tf.Variable 'UnreadVariable'

#### Flashcard 7624249969932

Tags
#tensorflow #tensorflow-certificate
Question
changeable_tensor = tf.Variable([10, 7])

changeable_tensor[0] = 77

Output:
TypeError: 'ResourceVariable' object does not support item assignment

changeable_tensor[0].[...]

Output:
<tf.Variable 'UnreadVariable' shape=(2,) dtype=int32, numpy=array([77,  7], dtype=int32)>

assign(77)

status measured difficulty not learned 37% [default] 0

Tensorflow basics
changeable_tensor = tf.Variable([10, 7]) changeable_tensor[0] = 77 Output: TypeError: 'ResourceVariable' object does not support item assignment changeable_tensor[0].assign(77) Output: <tf.Variable 'UnreadVariable' shape=(2,) dtype=int32, numpy=array([77, 7], dtype=int32)>

#### Flashcard 7624251018508

Tags
#tensorflow #tensorflow-certificate
Question
changeable_tensor = tf.Variable([10, 7])

changeable_tensor[0] [...]

Output:
TypeError: 'ResourceVariable' object does not support item assignment

changeable_tensor[0].assign(77)

Output:
<tf.Variable 'UnreadVariable' shape=(2,) dtype=int32, numpy=array([77,  7], dtype=int32)>

= 77

status measured difficulty not learned 37% [default] 0

Tensorflow basics
changeable_tensor = tf.Variable([10, 7]) changeable_tensor[0] = 77 Output: TypeError: 'ResourceVariable' object does not support item assignment changeable_tensor[0].assign(77) Output: <tf.Variable 'UnreadVariable' shape=(2,) dtype=int32, numpy=arra

#### Flashcard 7624252067084

Tags
#tensorflow #tensorflow-certificate
Question
changeable_tensor = tf.Variable([10, 7])

changeable_tensor[0] = 77

Output:
TypeError: 'ResourceVariable' object does not support item assignment

changeable_tensor[0].assign(77)

Output:
<tf.Variable 'UnreadVariable' shape=(2,) dtype=int32, numpy=array([[...]], dtype=int32)>