This neural network: model = keras.Sequential() model.add(layers.Dense(units=5,…
- User
This neural network: model = keras.Sequential() model.add(layers.Dense(units=5, activation='relu', input_shape=(X_train.shape[1],))) model.add(layers.Dense(units=46, activation='relu')) model.add(layers.Dense(3, activation='softmax'))
model.compile(optimizer=keras.optimizers.Adam(0.00021677996581918012), loss='sparse_categorical_crossentropy', metrics=['accuracy']) model.fit(X_train, y_train1, epochs=29, batch_size=17, verbose=0) for y_train with values 0,1,2 appears to be putting 2 everywhere even if the classess are of similar number of instances in training dataset. Fix that neural network.
- Assistant
To fix the problem of your neural network predicting the same class everywhere, you should first analyze the input data and the training process. Here are a few things you might want to consider:
-
Check your data for errors: Ensure that the data is correctly formatted and that there are no issues with the way it is loaded.
-