Horje
add new dimension Code Example
add new dimension
xtrain = xtrain[..., np.newaxis]
xtrain = xtrain[..., None]
xtrain = xtrain.reshape(-1, 28, 28, 1)
xtrain = tf.reshape(xtrain, (-1, 28, 28, 1))
xtrain = np.expand_dims(xtrain, axis=-1)
add new dimension

image = image[..., np.newaxis]

Source: devarama.com




Python

Related
python compressed for concatenate string Code Example python compressed for concatenate string Code Example
how to load a keras model with custom loss function Code Example how to load a keras model with custom loss function Code Example
Read large SAS file ilarger than memory n Python Code Example Read large SAS file ilarger than memory n Python Code Example
os Code Example os Code Example
get random bright hex color python Code Example get random bright hex color python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9