| 1021 | } |
| 1022 | |
| 1023 | void 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 | |
| 1042 | float train_networks(network **nets, int n, data d, int interval) |
| 1043 | { |
no test coverage detected