| 167 | |
| 168 | |
| 169 | convolutional_layer parse_convolutional(list *options, size_params params) |
| 170 | { |
| 171 | int n = option_find_int(options, "filters",1); |
| 172 | int size = option_find_int(options, "size",1); |
| 173 | int stride = option_find_int(options, "stride",1); |
| 174 | int pad = option_find_int_quiet(options, "pad",0); |
| 175 | int padding = option_find_int_quiet(options, "padding",0); |
| 176 | int groups = option_find_int_quiet(options, "groups", 1); |
| 177 | if(pad) padding = size/2; |
| 178 | |
| 179 | char *activation_s = option_find_str(options, "activation", "logistic"); |
| 180 | ACTIVATION activation = get_activation(activation_s); |
| 181 | |
| 182 | int batch,h,w,c; |
| 183 | h = params.h; |
| 184 | w = params.w; |
| 185 | c = params.c; |
| 186 | batch=params.batch; |
| 187 | if(!(h && w && c)) error("Layer before convolutional layer must output image."); |
| 188 | int batch_normalize = option_find_int_quiet(options, "batch_normalize", 0); |
| 189 | int binary = option_find_int_quiet(options, "binary", 0); |
| 190 | int xnor = option_find_int_quiet(options, "xnor", 0); |
| 191 | |
| 192 | convolutional_layer layer = make_convolutional_layer(batch,h,w,c,n,groups,size,stride,padding,activation, batch_normalize, binary, xnor, params.net->adam); |
| 193 | layer.flipped = option_find_int_quiet(options, "flipped", 0); |
| 194 | layer.dot = option_find_float_quiet(options, "dot", 0); |
| 195 | |
| 196 | return layer; |
| 197 | } |
| 198 | |
| 199 | layer parse_crnn(list *options, size_params params) |
| 200 | { |
no test coverage detected