| 141 | } |
| 142 | |
| 143 | layer parse_deconvolutional(list *options, size_params params) |
| 144 | { |
| 145 | int n = option_find_int(options, "filters",1); |
| 146 | int size = option_find_int(options, "size",1); |
| 147 | int stride = option_find_int(options, "stride",1); |
| 148 | |
| 149 | char *activation_s = option_find_str(options, "activation", "logistic"); |
| 150 | ACTIVATION activation = get_activation(activation_s); |
| 151 | |
| 152 | int batch,h,w,c; |
| 153 | h = params.h; |
| 154 | w = params.w; |
| 155 | c = params.c; |
| 156 | batch=params.batch; |
| 157 | if(!(h && w && c)) error("Layer before deconvolutional layer must output image."); |
| 158 | int batch_normalize = option_find_int_quiet(options, "batch_normalize", 0); |
| 159 | int pad = option_find_int_quiet(options, "pad",0); |
| 160 | int padding = option_find_int_quiet(options, "padding",0); |
| 161 | if(pad) padding = size/2; |
| 162 | |
| 163 | layer l = make_deconvolutional_layer(batch,h,w,c,n,size,stride,padding, activation, batch_normalize, params.net->adam); |
| 164 | |
| 165 | return l; |
| 166 | } |
| 167 | |
| 168 | |
| 169 | convolutional_layer parse_convolutional(list *options, size_params params) |
no test coverage detected