Merge pull request #4994 from Tclack88/master

Update classifier.c
pull/5002/head
Alexey 5 years ago committed by GitHub
commit c993a4bbe3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/classifier.c

@ -753,13 +753,14 @@ void try_classifier(char *datacfg, char *cfgfile, char *weightfile, char *filena
float *predictions = network_predict(net, X); float *predictions = network_predict(net, X);
layer l = net.layers[layer_num]; layer l = net.layers[layer_num];
for(int i = 0; i < l.c; ++i){ int i;
for(i = 0; i < l.c; ++i){
if(l.rolling_mean) printf("%f %f %f\n", l.rolling_mean[i], l.rolling_variance[i], l.scales[i]); if(l.rolling_mean) printf("%f %f %f\n", l.rolling_mean[i], l.rolling_variance[i], l.scales[i]);
} }
#ifdef GPU #ifdef GPU
cuda_pull_array(l.output_gpu, l.output, l.outputs); cuda_pull_array(l.output_gpu, l.output, l.outputs);
#endif #endif
for(int i = 0; i < l.outputs; ++i){ for(i = 0; i < l.outputs; ++i){
printf("%f\n", l.output[i]); printf("%f\n", l.output[i]);
} }
/* /*
@ -777,7 +778,7 @@ void try_classifier(char *datacfg, char *cfgfile, char *weightfile, char *filena
top_predictions(net, top, indexes); top_predictions(net, top, indexes);
printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time)); printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
for(int i = 0; i < top; ++i){ for(i = 0; i < top; ++i){
int index = indexes[i]; int index = indexes[i];
printf("%s: %f\n", names[index], predictions[index]); printf("%s: %f\n", names[index], predictions[index]);
} }

Loading…
Cancel
Save