| | |
| | | #include "list.h" |
| | | #include "option_list.h" |
| | | #include "utils.h" |
| | | #include "opencl.h" |
| | | |
| | | typedef struct{ |
| | | char *type; |
| | |
| | | net->learning_rate = learning_rate; |
| | | net->momentum = momentum; |
| | | net->decay = decay; |
| | | net->seen = option_find_int(options, "seen",0); |
| | | }else{ |
| | | learning_rate = option_find_float_quiet(options, "learning_rate", net->learning_rate); |
| | | momentum = option_find_float_quiet(options, "momentum", net->momentum); |
| | |
| | | if(count == 0){ |
| | | input = option_find_int(options, "input",1); |
| | | net->batch = option_find_int(options, "batch",1); |
| | | net->seen = option_find_int(options, "seen",0); |
| | | }else{ |
| | | input = get_network_output_size_layer(*net, count-1); |
| | | } |
| | |
| | | if(count == 0){ |
| | | input = option_find_int(options, "input",1); |
| | | net->batch = option_find_int(options, "batch",1); |
| | | net->seen = option_find_int(options, "seen",0); |
| | | }else{ |
| | | input = get_network_output_size_layer(*net, count-1); |
| | | } |
| | |
| | | net->learning_rate = learning_rate; |
| | | net->momentum = momentum; |
| | | net->decay = decay; |
| | | net->seen = option_find_int(options, "seen",0); |
| | | }else{ |
| | | image m = get_network_image_layer(*net, count-1); |
| | | h = m.h; |
| | |
| | | w = option_find_int(options, "width",1); |
| | | c = option_find_int(options, "channels",1); |
| | | net->batch = option_find_int(options, "batch",1); |
| | | net->seen = option_find_int(options, "seen",0); |
| | | }else{ |
| | | image m = get_network_image_layer(*net, count-1); |
| | | h = m.h; |
| | |
| | | return layer; |
| | | } |
| | | |
| | | /* |
| | | freeweight_layer *parse_freeweight(list *options, network *net, int count) |
| | | { |
| | | int input; |
| | |
| | | option_unused(options); |
| | | return layer; |
| | | } |
| | | */ |
| | | |
| | | dropout_layer *parse_dropout(list *options, network *net, int count) |
| | | { |
| | |
| | | net->learning_rate = learning_rate; |
| | | net->momentum = momentum; |
| | | net->decay = decay; |
| | | net->seen = option_find_int(options, "seen",0); |
| | | }else{ |
| | | input = get_network_output_size_layer(*net, count-1); |
| | | } |
| | |
| | | w = option_find_int(options, "width",1); |
| | | c = option_find_int(options, "channels",1); |
| | | net->batch = option_find_int(options, "batch",1); |
| | | net->seen = option_find_int(options, "seen",0); |
| | | }else{ |
| | | image m = get_network_image_layer(*net, count-1); |
| | | h = m.h; |
| | |
| | | net.types[count] = DROPOUT; |
| | | net.layers[count] = layer; |
| | | }else if(is_freeweight(s)){ |
| | | freeweight_layer *layer = parse_freeweight(options, &net, count); |
| | | net.types[count] = FREEWEIGHT; |
| | | net.layers[count] = layer; |
| | | //freeweight_layer *layer = parse_freeweight(options, &net, count); |
| | | //net.types[count] = FREEWEIGHT; |
| | | //net.layers[count] = layer; |
| | | fprintf(stderr, "Type not recognized: %s\n", s->type); |
| | | }else{ |
| | | fprintf(stderr, "Type not recognized: %s\n", s->type); |
| | | } |
| | |
| | | "channels=%d\n" |
| | | "learning_rate=%g\n" |
| | | "momentum=%g\n" |
| | | "decay=%g\n", |
| | | l->batch,l->h, l->w, l->c, l->learning_rate, l->momentum, l->decay); |
| | | "decay=%g\n" |
| | | "seen=%d\n", |
| | | l->batch,l->h, l->w, l->c, l->learning_rate, l->momentum, l->decay, net.seen); |
| | | } else { |
| | | if(l->learning_rate != net.learning_rate) |
| | | fprintf(fp, "learning_rate=%g\n", l->learning_rate); |
| | |
| | | "input=%d\n" |
| | | "learning_rate=%g\n" |
| | | "momentum=%g\n" |
| | | "decay=%g\n", |
| | | l->batch, l->inputs, l->learning_rate, l->momentum, l->decay); |
| | | "decay=%g\n" |
| | | "seen=%d\n", |
| | | l->batch, l->inputs, l->learning_rate, l->momentum, l->decay, net.seen); |
| | | } else { |
| | | if(l->learning_rate != net.learning_rate) |
| | | fprintf(fp, "learning_rate=%g\n", l->learning_rate); |
| | |
| | | "channels=%d\n" |
| | | "learning_rate=%g\n" |
| | | "momentum=%g\n" |
| | | "decay=%g\n", |
| | | l->batch,l->h, l->w, l->c, net.learning_rate, net.momentum, net.decay); |
| | | "decay=%g\n" |
| | | "seen=%d\n", |
| | | l->batch,l->h, l->w, l->c, net.learning_rate, net.momentum, net.decay, net.seen); |
| | | } |
| | | fprintf(fp, "crop_height=%d\ncrop_width=%d\nflip=%d\n\n", l->crop_height, l->crop_width, l->flip); |
| | | } |