im training a model using tensorflow in vscode and and jupyter notebook currently the…
- User
im training a model using tensorflow in vscode and and jupyter notebook currently the training is in the following state : ... 68/68 [==============================] - 2s 24ms/step - loss: 0.0523 - mae: 0.1243 - val_loss: 0.1182 - val_mae: 0.1455 Epoch 11810/16000 68/68 [==============================] - 2s 24ms/step - loss: 0.0515 - mae: 0.1240 - val_loss: 0.1177 - val_mae: 0.1455 Epoch 11811/16000 68/68 [==============================] - 2s 25ms/step - loss: 0.0518 - mae: 0.1241 - val_loss: 0.1176 - val_mae: 0.1454
the starting was: Epoch 11810/16000 68/68 [==============================] - 2s 24ms/step - loss: 1.0515 - mae: 1.0240 - val_loss: 1.7277 - val_mae: 0.9455
if i currently interupt the training cell and stop it what would be the model current loss ? would it be save last learned 68/68 [==============================] - 2s 25ms/step - loss: 0.0518 - mae: 0.1241 - val_loss: 0.1176 - val_mae: 0.1454 or it will be in starting state?
- Assistant
If you interrupt the training process in TensorFlow, especially when using Keras through either VSCode or Jupyter Notebook, the model's current state—including its weights, biases, and thus its loss and metrics—will be as they were at the last completed epoch. This means that if you stop the training at Epoch 11811, the model's state would reflect the training as of the completion of that epoch, not reverting back to the starting state.
Therefore, the model's last saved state in terms of loss and metrics would indeed be:
code- loss: 0.0518 - mae: 0.1241 - val_loss: 0.1176 - val_mae: 0.1454However, this assumes you haven't implemented any specific model checkpointing that saves models at intervals or based on specific conditions like improvement in validation loss. TensorFlow's callback can be used to save the model at regular intervals during training, which ensures you can retrieve a model state from any point where a checkpoint was saved, not just the most recent epoch.