mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Saving loss-chart for each 100 iterations automatically
This commit is contained in:
@ -716,7 +716,8 @@ void update_convolutional_layer_gpu(convolutional_layer layer, int batch, float
|
||||
// = weights_new*(1 - decay*lr) - weights_old*momentum*decay*lr + (weights_update_new + weights_update_old*momentum)*lr/batch
|
||||
|
||||
//------------- RESULT --------------
|
||||
// weights_newest = weights_new*(1 - decay*lr) - weights_old*momentum*(decay*lr) + (weights_update_new + weights_update_old*momentum)*lr/batch
|
||||
// weights_newest = weights_new*(1 - decay*lr) - weights_old*momentum*(decay*lr) + (weights_update_new + weights_update_old*momentum)*lr/batch =
|
||||
// = weights_new - (weights_new + weights_old*momentum)*decay*lr + (weights_update_new + weights_update_old*momentum)*lr / batch
|
||||
//-----------------------------------
|
||||
}
|
||||
}
|
||||
|
@ -739,7 +739,7 @@ void draw_train_loss(IplImage* img, int img_size, float avg_loss, float max_img_
|
||||
cvPutText(img, char_buff, pt1, &font, CV_RGB(0, 0, 0));
|
||||
cvShowImage("average loss", img);
|
||||
int k = cvWaitKey(20);
|
||||
if (k == 's' || current_batch == (max_batches - 1)) {
|
||||
if (k == 's' || current_batch == (max_batches - 1) || current_batch % 100 == 0) {
|
||||
cvSaveImage("chart.jpg", img, 0);
|
||||
cvPutText(img, "- Saved", cvPoint(250, img_size - 10), &font, CV_RGB(255, 0, 0));
|
||||
}
|
||||
|
Reference in New Issue
Block a user