Replies: 1 comment
-
Hey @Chikamalu , there is a slight difference in |
Beta Was this translation helpful? Give feedback.
-
Hey @Chikamalu , there is a slight difference in |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Everyone
Please i am at the point of building a multiclass model and i built one with the input as integers and loss as categorical entropy and my code ran. i was expecting an error.
below is the code.
could you look at this and tell me what you think.
thanks
`import tensorflow as tf
from tensorflow.keras.datasets import fashion_mnist
The data has already been sorted into training and test sets for us
(train_data, train_labels), (test_data, test_labels) = fashion_mnist.load_data()
Set random seed
tf.random.set_seed(42)
Build the model
model_12 = tf.keras.Sequential([
tf.keras.layers.Flatten(input_shape=(28, 28)), # input layer (we had to reshape 28x28 to 784, the Flatten layer does this for us)
tf.keras.layers.Dense(3, activation = "relu"),
tf.keras.layers.Dense(3, activation= "relu"),
tf.keras.layers.Dense(1, activation = "softmax")
])
Compile the model
model_12.compile(loss= "CategoricalCrossentropy",
optimizer = tf.keras.optimizers.Adam(),
metrics=["accuracy"])
Fit the model
non_norm_history1 = model_12.fit(train_data,
train_labels,
epochs=10,
validation_data=(test_data, test_labels), verbose=1)`
Beta Was this translation helpful? Give feedback.
All reactions