comparison src/EM.cpp @ 164:629c9525b815

Some measurements suggest we get slightly better results with more iterations, but not drastically worse with fewer -- so go lower for draft and higher for hq mode
author Chris Cannam
date Tue, 20 May 2014 16:21:33 +0100
parents 6003a9af43af
children 237d41a0f69d
comparison
equal deleted inserted replaced
163:6e9ddd07dc3c 164:629c9525b815
180 v_add_with_gain(m_estimate, w, factor, m_binCount); 180 v_add_with_gain(m_estimate, w, factor, m_binCount);
181 } 181 }
182 } 182 }
183 } 183 }
184 184
185 //!!! try normalising so as to sum to unity and then taking L2
186 //!!! norm of the two (for measure of how close they are)
187
188 for (int i = 0; i < m_binCount; ++i) { 185 for (int i = 0; i < m_binCount; ++i) {
189 m_q[i] = column[i] / m_estimate[i]; 186 m_q[i] = column[i] / m_estimate[i];
190 } 187 }
188
189 /*
190 double l2norm = 0.0;
191
192 for (int i = 0; i < m_binCount; ++i) {
193 l2norm += (column[i] - m_estimate[i]) * (column[i] - m_estimate[i]);
194 }
195
196 l2norm = sqrt(l2norm);
197 cerr << "l2norm = " << l2norm << endl;
198 */
191 } 199 }
192 200
193 void 201 void
194 EM::maximisation(const float *column) 202 EM::maximisation(const float *column)
195 { 203 {