| | |
| | | best_index = 0; |
| | | } |
| | | } |
| | | /* |
| | | if(1 && *(state.net.seen) < 100000){ |
| | | best_index = rand()%l.n; |
| | | } |
| | | */ |
| | | |
| | | int box_index = index + locations*(l.classes + l.n) + (i*l.n + best_index) * l.coords; |
| | | int tbox_index = truth_index + 1 + l.classes; |
| | |
| | | for (b = 0; b < l.batch; ++b) { |
| | | int index = b*l.inputs; |
| | | for (i = 0; i < locations; ++i) { |
| | | int truth_index = (b*locations + i)*(1+l.coords+l.classes); |
| | | for (j = 0; j < l.n; ++j) { |
| | | int p_index = index + locations*l.classes + i*l.n + j; |
| | | costs[b*locations*l.n + i*l.n + j] = l.delta[p_index]*l.delta[p_index]; |
| | |
| | | for (b = 0; b < l.batch; ++b) { |
| | | int index = b*l.inputs; |
| | | for (i = 0; i < locations; ++i) { |
| | | int truth_index = (b*locations + i)*(1+l.coords+l.classes); |
| | | for (j = 0; j < l.n; ++j) { |
| | | int p_index = index + locations*l.classes + i*l.n + j; |
| | | if (l.delta[p_index]*l.delta[p_index] < cutoff) l.delta[p_index] = 0; |
| | |
| | | cuda_pull_array(state.truth, truth_cpu, num_truth); |
| | | } |
| | | cuda_pull_array(state.input, in_cpu, l.batch*l.inputs); |
| | | network_state cpu_state; |
| | | network_state cpu_state = state; |
| | | cpu_state.train = state.train; |
| | | cpu_state.truth = truth_cpu; |
| | | cpu_state.input = in_cpu; |