Joseph Redmon
2014-12-18 f88baf4a3a756140cef3ca07be98cabb803d80ae
src/parser.c
@@ -165,7 +165,9 @@
    }else{
        input =  get_network_output_size_layer(*net, count-1);
    }
    cost_layer *layer = make_cost_layer(net->batch, input);
    char *type_s = option_find_str(options, "type", "sse");
    COST_TYPE type = get_cost_type(type_s);
    cost_layer *layer = make_cost_layer(net->batch, input, type);
    option_unused(options);
    return layer;
}
@@ -243,6 +245,12 @@
    if(count == 0){
        net->batch = option_find_int(options, "batch",1);
        input = option_find_int(options, "input",1);
        float learning_rate = option_find_float(options, "learning_rate", .001);
        float momentum = option_find_float(options, "momentum", .9);
        float decay = option_find_float(options, "decay", .0001);
        net->learning_rate = learning_rate;
        net->momentum = momentum;
        net->decay = decay;
    }else{
        input =  get_network_output_size_layer(*net, count-1);
    }
@@ -565,7 +573,7 @@
void print_cost_cfg(FILE *fp, cost_layer *l, network net, int count)
{
    fprintf(fp, "[cost]\n");
    fprintf(fp, "[cost]\ntype=%s\n", get_cost_string(l->type));
    if(count == 0) fprintf(fp, "batch=%d\ninput=%d\n", l->batch, l->inputs);
    fprintf(fp, "\n");
}