MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / sync_nets

Function sync_nets

yolo_detector/darknet_opt/src/network.c:1023–1040  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1021}
1022
1023void sync_nets(network **nets, int n, int interval)
1024{
1025 int j;
1026 int layers = nets[0]->n;
1027 pthread_t *threads = (pthread_t *) calloc(layers, sizeof(pthread_t));
1028
1029 *(nets[0]->seen) += interval * (n-1) * nets[0]->batch * nets[0]->subdivisions;
1030 for (j = 0; j < n; ++j){
1031 *(nets[j]->seen) = *(nets[0]->seen);
1032 }
1033 for (j = 0; j < layers; ++j) {
1034 threads[j] = sync_layer_in_thread(nets, n, j);
1035 }
1036 for (j = 0; j < layers; ++j) {
1037 pthread_join(threads[j], 0);
1038 }
1039 free(threads);
1040}
1041
1042float train_networks(network **nets, int n, data d, int interval)
1043{

Callers 2

train_networksFunction · 0.85
train_detectorFunction · 0.85

Calls 1

sync_layer_in_threadFunction · 0.85

Tested by

no test coverage detected