MCPcopy Create free account
hub / github.com/davisking/dlib / process_batch

Method process_batch

dlib/dnn/core.h:2534–2553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2532
2533 template <typename iterable_type, typename ...T>
2534 std::vector<output_label_type> process_batch (const iterable_type& data, size_t batch_size, T&& ...args)
2535 {
2536 std::vector<output_label_type> results(std::distance(data.begin(), data.end()));
2537 auto o = results.begin();
2538 auto i = data.begin();
2539 auto num_remaining = results.size();
2540 while(num_remaining != 0)
2541 {
2542 auto inc = std::min(batch_size, num_remaining);
2543 to_tensor(i,i+inc,temp_tensor);
2544 subnetwork.forward(temp_tensor);
2545 const dimpl::subnet_wrapper<subnet_type> wsub(subnetwork);
2546 loss.to_label(temp_tensor, wsub, o, std::forward<T>(args)...);
2547
2548 i += inc;
2549 o += inc;
2550 num_remaining -= inc;
2551 }
2552 return results;
2553 }
2554
2555 void back_propagate_error(
2556 const tensor& x,

Callers

nothing calls this directly

Calls 7

distanceFunction · 0.50
minFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
forwardMethod · 0.45
to_labelMethod · 0.45

Tested by

no test coverage detected