Joseph Redmon
2014-10-30 27d0c922eab34025327d885c2137f7168b6130b7
im2col actually works now
2 files modified
12 ■■■■ changed files
src/im2col.cl 4 ●●●● patch | view | raw | blame | history
src/network.c 8 ●●●● patch | view | raw | blame | history
src/im2col.cl
@@ -28,7 +28,7 @@
    int im_row = h_offset + h * stride - pad;
    int im_col = w_offset + w * stride - pad;
    int im_index = im_col + width*(im_row + height*(im_channel+batch*channels));
    int im_index = im_col + width*(im_row + height*(im_channel+b*channels));
    float val = (im_row < 0 || im_col < 0 || im_row >= height || im_col >= width) ? 0 : im[im_index];
    data_col[col_index] = val;
@@ -61,7 +61,7 @@
    int im_row = h_offset + h * stride;
    int im_col = w_offset + w * stride;
    int im_index = im_col + width*(im_row + height*(im_channel+batch*channels));
    int im_index = im_col + width*(im_row + height*(im_channel+b*channels));
    float val = (im_row < 0 || im_col < 0 || im_row >= height || im_col >= width) ? 0 : im[im_index];
    data_col[col_index] = val;
src/network.c
@@ -38,7 +38,7 @@
    //printf("start\n");
    int i;
    for(i = 0; i < net.n; ++i){
        clock_t time = clock();
        //clock_t time = clock();
        if(net.types[i] == CONVOLUTIONAL){
            convolutional_layer layer = *(convolutional_layer *)net.layers[i];
            forward_convolutional_layer_gpu(layer, input);
@@ -63,7 +63,7 @@
            forward_softmax_layer_gpu(layer, input);
            input = layer.output_cl;
        }
        printf("%d %f\n", i, sec(clock()-time));
        //printf("%d %f\n", i, sec(clock()-time));
        /*
           else if(net.types[i] == CROP){
           crop_layer layer = *(crop_layer *)net.layers[i];
@@ -85,7 +85,7 @@
    cl_mem prev_input;
    cl_mem prev_delta;
    for(i = net.n-1; i >= 0; --i){
        clock_t time = clock();
        //clock_t time = clock();
        if(i == 0){
            prev_input = input;
            prev_delta = 0;
@@ -113,7 +113,7 @@
            softmax_layer layer = *(softmax_layer *)net.layers[i];
            backward_softmax_layer_gpu(layer, prev_delta);
        }
        printf("back: %d %f\n", i, sec(clock()-time));
        //printf("back: %d %f\n", i, sec(clock()-time));
    }
}