| | |
| | | save_weights(net, buff); |
| | | return; |
| | | } |
| | | if(i%1000==0 || 1){ |
| | | if(i%1000==0){ |
| | | char buff[256]; |
| | | sprintf(buff, "%s/%s_%d.weights", backup_directory, base, i); |
| | | save_weights(net, buff); |
| | | } |
| | | free_data(train); |
| | | return; |
| | | } |
| | | char buff[256]; |
| | | sprintf(buff, "%s/%s_final.weights", backup_directory, base); |
| | |
| | | #include <stdio.h> |
| | | #include <math.h> |
| | | inline void col2im_add_pixel(float *im, int height, int width, int channels, |
| | | void col2im_add_pixel(float *im, int height, int width, int channels, |
| | | int row, int col, int channel, int pad, float val) |
| | | { |
| | | row -= pad; |
| | |
| | | #include "im2col.h" |
| | | #include <stdio.h> |
| | | inline float im2col_get_pixel(float *im, int height, int width, int channels, |
| | | float im2col_get_pixel(float *im, int height, int width, int channels, |
| | | int row, int col, int channel, int pad) |
| | | { |
| | | row -= pad; |
| | |
| | | avg_loss = avg_loss*.9 + loss*.1; |
| | | printf("%d: %f, %f avg, %lf seconds, %d images\n", i, loss, avg_loss, sec(clock()-time), net.seen); |
| | | free_data(train); |
| | | if((i % 35000) == 0) net.learning_rate *= .1; |
| | | if((i % 30000) == 0) net.learning_rate *= .1; |
| | | if(i%1000==0){ |
| | | char buff[256]; |
| | | sprintf(buff, "/home/pjreddie/imagenet_backup/%s_%d.weights",base, i); |
| | |
| | | #include "image.h" |
| | | #include "data.h" |
| | | #include "utils.h" |
| | | #include "blas.h" |
| | | |
| | | #include "crop_layer.h" |
| | | #include "connected_layer.h" |
| | |
| | | { |
| | | float probability = option_find_float(options, "probability", .5); |
| | | dropout_layer layer = make_dropout_layer(params.batch, params.inputs, probability); |
| | | layer.out_w = params.w; |
| | | layer.out_h = params.h; |
| | | layer.out_c = params.c; |
| | | return layer; |
| | | } |
| | | |