diff --git a/src/convolutional_kernels.cu b/src/convolutional_kernels.cu index d7220010..6824083e 100644 --- a/src/convolutional_kernels.cu +++ b/src/convolutional_kernels.cu @@ -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 //----------------------------------- } } diff --git a/src/image.c b/src/image.c index 155afba9..60cd9cb3 100644 --- a/src/image.c +++ b/src/image.c @@ -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)); }