| | |
| | | #include "crop_layer.h" |
| | | #include "cost_layer.h" |
| | | #include "convolutional_layer.h" |
| | | #include "activation_layer.h" |
| | | #include "normalization_layer.h" |
| | | #include "deconvolutional_layer.h" |
| | | #include "connected_layer.h" |
| | |
| | | |
| | | int is_network(section *s); |
| | | int is_convolutional(section *s); |
| | | int is_activation(section *s); |
| | | int is_local(section *s); |
| | | int is_deconvolutional(section *s); |
| | | int is_connected(section *s); |
| | |
| | | layer from = net.layers[index]; |
| | | |
| | | layer s = make_shortcut_layer(batch, index, params.w, params.h, params.c, from.out_w, from.out_h, from.out_c); |
| | | |
| | | char *activation_s = option_find_str(options, "activation", "linear"); |
| | | ACTIVATION activation = get_activation(activation_s); |
| | | s.activation = activation; |
| | | return s; |
| | | } |
| | | |
| | | |
| | | layer parse_activation(list *options, size_params params) |
| | | { |
| | | char *activation_s = option_find_str(options, "activation", "linear"); |
| | | ACTIVATION activation = get_activation(activation_s); |
| | | |
| | | layer l = make_activation_layer(params.batch, params.inputs, activation); |
| | | |
| | | l.out_h = params.h; |
| | | l.out_w = params.w; |
| | | l.out_c = params.c; |
| | | l.h = params.h; |
| | | l.w = params.w; |
| | | l.c = params.c; |
| | | |
| | | return l; |
| | | } |
| | | |
| | | route_layer parse_route(list *options, size_params params, network net) |
| | | { |
| | | char *l = option_find(options, "layers"); |
| | |
| | | l = parse_convolutional(options, params); |
| | | }else if(is_local(s)){ |
| | | l = parse_local(options, params); |
| | | }else if(is_activation(s)){ |
| | | l = parse_activation(options, params); |
| | | }else if(is_deconvolutional(s)){ |
| | | l = parse_deconvolutional(options, params); |
| | | }else if(is_connected(s)){ |
| | |
| | | return (strcmp(s->type, "[conv]")==0 |
| | | || strcmp(s->type, "[convolutional]")==0); |
| | | } |
| | | int is_activation(section *s) |
| | | { |
| | | return (strcmp(s->type, "[activation]")==0); |
| | | } |
| | | int is_network(section *s) |
| | | { |
| | | return (strcmp(s->type, "[net]")==0 |