Take the First Step to Artificial Intelligence with the Best! | Certified Introduction to AI, Robotics and Data course is now Free

Join Global AI Hub Now!

x

Home Forums Forum: Derin Öğrenmeye Giriş YARDIM Reply To: YARDIM

  • Mustafa Yığman

    Member
    September 11, 2021 at 7:00 pm

    seed(1)

    random.set_seed(1) #model değerlerini sabitleme

    cb = tf.keras.callbacks.EarlyStopping(monitor=’val_loss’)

    model = Sequential()

    model.add(LSTM(256, activation=’relu’, input_shape=(n_steps_in, n_features)))

    model.add(Dropout(0.5))

    model.add(RepeatVector(n_steps_out))

    model.add(LSTM(256, activation=’relu’, return_sequences=True))

    model.add(Dropout(0.5))

    model.add(TimeDistributed(Dense(n_features)))

    opt = keras.optimizers.Adam(learning_rate=0.0001)

    model.compile(loss=’mse’, optimizer=opt, metrics=[RootMeanSquaredError()])

    history = model.fit(X_train, y_train, shuffle=False, epochs=150, batch_size=8, verbose=’auto’, callbacks=[cb], validation_data=(X_test, y_test))

    opt_epoch=len(history.history[‘loss’])

    opt_epoch

    test_eval=model.evaluate(X_test,y_test, verbose=1)

    print(test_eval)

    Kod satrları bunlar, history satırındaki model.fit içinde bu hatayı alıyorum.

    ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type float).