From 54d761cf9efa6c77e96855ea80156b0fcd81195d Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Tue, 22 Sep 2015 22:40:15 +0000
Subject: [PATCH] resize image width 1 ><

---
 src/network_kernels.cu |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/network_kernels.cu b/src/network_kernels.cu
index 593de0a..cfc6e83 100644
--- a/src/network_kernels.cu
+++ b/src/network_kernels.cu
@@ -1,6 +1,7 @@
 extern "C" {
 #include <stdio.h>
 #include <time.h>
+#include <assert.h>
 
 #include "network.h"
 #include "image.h"
@@ -115,14 +116,15 @@
 {
     int i;
     int update_batch = net.batch*net.subdivisions;
+    float rate = get_current_rate(net);
     for(i = 0; i < net.n; ++i){
         layer l = net.layers[i];
         if(l.type == CONVOLUTIONAL){
-            update_convolutional_layer_gpu(l, update_batch, net.learning_rate, net.momentum, net.decay);
+            update_convolutional_layer_gpu(l, update_batch, rate, net.momentum, net.decay);
         } else if(l.type == DECONVOLUTIONAL){
-            update_deconvolutional_layer_gpu(l, net.learning_rate, net.momentum, net.decay);
+            update_deconvolutional_layer_gpu(l, rate, net.momentum, net.decay);
         } else if(l.type == CONNECTED){
-            update_connected_layer_gpu(l, update_batch, net.learning_rate, net.momentum, net.decay);
+            update_connected_layer_gpu(l, update_batch, rate, net.momentum, net.decay);
         }
     }
 }
@@ -132,6 +134,7 @@
     network_state state;
     int x_size = get_network_input_size(net)*net.batch;
     int y_size = get_network_output_size(net)*net.batch;
+    if(net.layers[net.n-1].type == REGION) y_size = net.layers[net.n-1].truths*net.batch;
     if(!*net.input_gpu){
         *net.input_gpu = cuda_make_array(x, x_size);
         *net.truth_gpu = cuda_make_array(y, y_size);
@@ -146,7 +149,7 @@
     forward_network_gpu(net, state);
     backward_network_gpu(net, state);
     float error = get_network_cost(net);
-    if ((net.seen / net.batch) % net.subdivisions == 0) update_network_gpu(net);
+    if (((*net.seen) / net.batch) % net.subdivisions == 0) update_network_gpu(net);
 
     return error;
 }

--
Gitblit v1.10.0