Providing validation_data in model.fit() of music generation exercise

I want to split data into train, test and validate . I have done it offline

in the below code snipped for this exercise
history = model.fit([X, a0, c0], list(Y), epochs=100, verbose = 0)

suppose i want to add validation_data=([X_val], Y_val) .

After adding this I am getting below error after completion of 1st epoch

ValueError: Layer “model_7” expects 3 input(s), but it received 1 input tensors

Also I have below query

  1. for validation_data=([X_val ], Y_val) is it not required to pass c0, s0? If we have to pass it then what should I pass?
  2. for model.evaluate() is it not required to pass c0, s0? If we have to pass it then what should I pass?

Below is my code snippet

history = model2.fit(
[X_train, s0, c0],
Y_train,
epochs=epochs,
batch_size=batch_size,
validation_data=([X_val], Y_val),
)

Evaluate the model on test data

test_loss, test_accuracy = model.evaluate([X_test], Y_test)

Please pass zeros of appropriate shape for both a0 and c0 for validation and test sets.

1 Like