0
votes

I would like to train my model in Keras using model.fit method.

From what I understand, first, it takes the input X_train, makes a prediction and then compares it with y_train to calculate the loss and backpropagate. Is there a way to start training only by inputting the true labels (y_true) and predicted labels (y_pred) and not X_train?

1
What do you plan to achieve by removing the input from the training process? How do you expect the model to learn making predictions without having any input to work on? - ilim
The input is indirectly given, those are the predictions y_pred made by the network before (I needed to first make prediction on the network initially before training it). Then I get y_true and I want keras to minimize the loss between y_pred and y_true and not use the X_train implicitely. - dtransposed
But if you do not have the training data, you can't compute the gradients that are needed for the optimising step. Those machine learning models try to find a function that given an input (X_train) produces a certain output (y_train). That just doesn't work if you don't have the input. - sietschie

1 Answers

1
votes

No.

To fit, your model needs the input since the value taken in each layer given that input is taken into account during backpropagation. You might find the fundamentals of machine learning useful : http://neuralnetworksanddeeplearning.com/index.html