mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Fine tuning, use stopbackward=1 in the cfg-file in that layer where Backward should be stopped.
This commit is contained in:
@ -122,6 +122,8 @@ struct layer{
|
|||||||
int classfix;
|
int classfix;
|
||||||
int absolute;
|
int absolute;
|
||||||
|
|
||||||
|
int onlyforward;
|
||||||
|
int stopbackward;
|
||||||
int dontload;
|
int dontload;
|
||||||
int dontloadscales;
|
int dontloadscales;
|
||||||
|
|
||||||
|
@ -218,6 +218,7 @@ void backward_network(network net, network_state state)
|
|||||||
state.delta = prev.delta;
|
state.delta = prev.delta;
|
||||||
}
|
}
|
||||||
layer l = net.layers[i];
|
layer l = net.layers[i];
|
||||||
|
if (l.stopbackward) break;
|
||||||
l.backward(l, state);
|
l.backward(l, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,6 +64,7 @@ void backward_network_gpu(network net, network_state state)
|
|||||||
for(i = net.n-1; i >= 0; --i){
|
for(i = net.n-1; i >= 0; --i){
|
||||||
state.index = i;
|
state.index = i;
|
||||||
layer l = net.layers[i];
|
layer l = net.layers[i];
|
||||||
|
if (l.stopbackward) break;
|
||||||
if(i == 0){
|
if(i == 0){
|
||||||
state.input = original_input;
|
state.input = original_input;
|
||||||
state.delta = original_delta;
|
state.delta = original_delta;
|
||||||
|
@ -672,6 +672,8 @@ network parse_network_cfg_custom(char *filename, int batch)
|
|||||||
}else{
|
}else{
|
||||||
fprintf(stderr, "Type not recognized: %s\n", s->type);
|
fprintf(stderr, "Type not recognized: %s\n", s->type);
|
||||||
}
|
}
|
||||||
|
l.onlyforward = option_find_int_quiet(options, "onlyforward", 0);
|
||||||
|
l.stopbackward = option_find_int_quiet(options, "stopbackward", 0);
|
||||||
l.dontload = option_find_int_quiet(options, "dontload", 0);
|
l.dontload = option_find_int_quiet(options, "dontload", 0);
|
||||||
l.dontloadscales = option_find_int_quiet(options, "dontloadscales", 0);
|
l.dontloadscales = option_find_int_quiet(options, "dontloadscales", 0);
|
||||||
option_unused(options);
|
option_unused(options);
|
||||||
|
Reference in New Issue
Block a user