|
|
@@ -103,16 +103,23 @@ void Project::UpdateScores(ProjectProgressHandler *progress_handler) {
|
|
|
Conv::datum total_sample_count = new_set_->GetSampleCount();
|
|
|
Conv::datum running_sample_count = 0;
|
|
|
|
|
|
+ unsigned int batch_size = prediction_buffer.combined_tensor->data.samples();
|
|
|
+
|
|
|
for(unsigned int s = 0; s < new_set_->GetSegmentCount(); s++) {
|
|
|
Conv::Segment* segment = new_set_->GetSegment(s);
|
|
|
Conv::datum segment_score = 0;
|
|
|
- for(unsigned int sample = 0; sample < segment->GetSampleCount(); sample++) {
|
|
|
- Conv::JSON& sample_json = segment->GetSample(sample);
|
|
|
- input_layer_->ForceLoadDetection(sample_json, 0);
|
|
|
+
|
|
|
+ for(unsigned int sample = 0; sample < segment->GetSampleCount(); sample+= batch_size) {
|
|
|
+ for(unsigned int bindex = 0; bindex < batch_size && (sample+bindex) < (segment->GetSampleCount()); bindex++) {
|
|
|
+ Conv::JSON& sample_json = segment->GetSample(sample+bindex);
|
|
|
+ input_layer_->ForceLoadDetection(sample_json, bindex);
|
|
|
+ }
|
|
|
graph_->FeedForward();
|
|
|
- segment_score += policy->Score(prediction_buffer.combined_tensor->data, predicted_metadata, 0);
|
|
|
- running_sample_count += 1.0;
|
|
|
- progress_handler->OnProjectProgressUpdate(running_sample_count / total_sample_count);
|
|
|
+ for(unsigned int bindex = 0; bindex < batch_size && (sample+bindex) < (segment->GetSampleCount()); bindex++) {
|
|
|
+ segment_score += policy->Score(prediction_buffer.combined_tensor->data, predicted_metadata, bindex);
|
|
|
+ running_sample_count += 1.0;
|
|
|
+ progress_handler->OnProjectProgressUpdate(running_sample_count / total_sample_count);
|
|
|
+ }
|
|
|
}
|
|
|
segment->score = segment_score;
|
|
|
}
|