time-series-forecasting-rnn-tensorflow icon indicating copy to clipboard operation
time-series-forecasting-rnn-tensorflow copied to clipboard

Why did you use model.fit for training?

Open hana9090 opened this issue 7 years ago • 1 comments

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?

hana9090 avatar Mar 22 '18 08:03 hana9090

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).

TheEdoardo93 avatar Feb 15 '21 23:02 TheEdoardo93