Getting nan in my training model. I've provided the code. Kindly help me in correcting the code. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Getting nan in my training model. I've provided the code. Kindly help me in correcting the code.

i am getting nan in my model when performing the training of the model- from sklearn.datasets import fetch_california_housing from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler housing = fetch_california_housing() X_train_full, X_test, y_train_full, y_test = train_test_split( housing.data, housing.target) X_train, X_valid, y_train, y_valid = train_test_split( X_train_full, y_train_full) input_A = keras.layers.Input(shape=[5]) input_B = keras.layers.Input(shape=[6]) hidden1 = keras.layers.Dense(30, activation=“relu”)(input_B) hidden2 = keras.layers.Dense(30, activation=“relu”)(hidden1) concat = keras.layers.concatenate([input_A, hidden2]) output = keras.layers.Dense(1)(concat) aux_output = keras.layers.Dense(1)(hidden2) model = keras.models.Model(inputs=[input_A, input_B], outputs=[output, aux_output]) model.compile(loss=[“mse”, “mse”], loss_weights=[0.9, 0.1], optimizer=“sgd”) X_train_A, X_train_B = X_train[:, :5], X_train[:, 2:] X_valid_A,

26th Jun 2020, 10:43 AM
Ambika Insa
Ambika Insa - avatar
1 Answer
0
There is no keras import at the start and your code in the question is clipped at the end. I would suggest creating a full code file of this question in your sololearn profile and link that code file in your question to let us better help you.
27th Jun 2020, 2:20 PM
fork()
fork() - avatar