| 1070 | } |
| 1071 | |
| 1072 | void sync_nets(network **nets, int n, int interval) |
| 1073 | { |
| 1074 | int j; |
| 1075 | int layers = nets[0]->n; |
| 1076 | pthread_t *threads = (pthread_t *) calloc(layers, sizeof(pthread_t)); |
| 1077 | |
| 1078 | *(nets[0]->seen) += interval * (n-1) * nets[0]->batch * nets[0]->subdivisions; |
| 1079 | for (j = 0; j < n; ++j){ |
| 1080 | *(nets[j]->seen) = *(nets[0]->seen); |
| 1081 | } |
| 1082 | for (j = 0; j < layers; ++j) { |
| 1083 | threads[j] = sync_layer_in_thread(nets, n, j); |
| 1084 | } |
| 1085 | for (j = 0; j < layers; ++j) { |
| 1086 | pthread_join(threads[j], 0); |
| 1087 | } |
| 1088 | free(threads); |
| 1089 | } |
| 1090 | |
| 1091 | float train_networks(network **nets, int n, data d, int interval) |
| 1092 | { |
no test coverage detected