src/sliding_fb.rs

changeset 78
2a122736e91c
parent 75
677a5fd1b014
equal deleted inserted replaced
77:be105c046777 78:2a122736e91c
1090 γ.get_transport_stats(&mut stats, &μ); 1090 γ.get_transport_stats(&mut stats, &μ);
1091 1091
1092 // Merge spikes. 1092 // Merge spikes.
1093 // This crucially expects the merge routine to be stable with respect to spike locations, 1093 // This crucially expects the merge routine to be stable with respect to spike locations,
1094 // and not to performing any pruning. That is be to done below simultaneously for γ. 1094 // and not to performing any pruning. That is be to done below simultaneously for γ.
1095 if config.insertion.merge_now(&state) { 1095 config.insertion.if_merge_now(&state, |ins| {
1096 let m = prox_penalty.merge_spikes( 1096 let m = prox_penalty.merge_spikes(
1097 &mut μ, 1097 &mut μ,
1098 &mut τv̆, 1098 &mut τv̆,
1099 &μ̆, 1099 &μ̆,
1100 τ, 1100 τ,
1101 ε, 1101 ε,
1102 &config.insertion, 1102 ins,
1103 &reg, 1103 &reg,
1104 Some(|μ̃: &RNDM<N, F>| f.apply(μ̃)), 1104 Some(|μ̃: &RNDM<N, F>| f.apply(μ̃)),
1105 ); 1105 );
1106 //if m > 0 { 1106 //if m > 0 {
1107 stats.merged += m; 1107 stats.merged += m;
1108 //v = f.differential(&μ); 1108 //v = f.differential(&μ);
1109 //} 1109 //}
1110 } 1110 });
1111 1111
1112 γ.prune_compat(&mut μ, &mut stats); 1112 γ.prune_compat(&mut μ, &mut stats);
1113 1113
1114 // Do extra weight optimisation step heuristic 1114 // Do extra weight optimisation step heuristic
1115 for _ in 1..config.insertion.extra_weight_optimisation_steps { 1115 for _ in 1..config.insertion.extra_weight_optimisation_steps {

mercurial