time-series-forecasting-rnn-tensorflow
time-series-forecasting-rnn-tensorflow copied to clipboard
Why did you use model.fit for training?
To train a model in Tensorflow I checked other sources they use sessions in loop in order to train model.
with tf.Session() as sess:
init.run()
for ep in range(epochs):
sess.run(training_op, feed_dict={X: x_batches, y:y_batches})
mse = loss.eval(feed_dict={X: x_batches, y:y_batches})
Why did you use model.fit?
To train a model in Tensorflow I checked other sources they use sessions in loop in order to train model.
with tf.Session() as sess: init.run() for ep in range(epochs): sess.run(training_op, feed_dict={X: x_batches, y:y_batches}) mse = loss.eval(feed_dict={X: x_batches, y:y_batches})Why did you use model.fit?
The code you wrote is TensorFlow 1.X, which is overpassed by TensorFlow 2.X (now we are at TensorFlow 2.4).
The fit() method is the simple way to train any Neural Network model implemented by using TensorFlow (with Keras API).