<divclass="center"><iframescrolling="no"frameborder="0"src="../../d0/dcb/group__kohonen__1d.svg"width="418"height="51"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
<trclass="memdesc:gaffe776513b24d84b39af8ab0930fef7f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">shorthand for maximum value <br/></td></tr>
<trclass="memdesc:gac6afabdc09a49a433ee19d8a9486056d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">shorthand for minimum value <br/></td></tr>
<trclass="memitem:gaf5ce14f026d6d231bef29161bac2b485"><tdclass="memItemLeft"align="right"valign="top">double </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d0/dcb/group__kohonen__1d.html#gaf5ce14f026d6d231bef29161bac2b485">_random</a> (double a, double b)</td></tr>
<trclass="memdesc:gaf5ce14f026d6d231bef29161bac2b485"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Helper function to generate a random number in a given interval. <ahref="../../d0/dcb/group__kohonen__1d.html#gaf5ce14f026d6d231bef29161bac2b485">More...</a><br/></td></tr>
<trclass="memitem:ga7b84b14e60f47812b581d1f93057c85a"><tdclass="memItemLeft"align="right"valign="top">int </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d0/dcb/group__kohonen__1d.html#ga7b84b14e60f47812b581d1f93057c85a">save_nd_data</a> (const char *fname, double **X, int num_points, int num_features)</td></tr>
<trclass="memdesc:ga7b84b14e60f47812b581d1f93057c85a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Save a given n-dimensional data martix to file. <ahref="../../d0/dcb/group__kohonen__1d.html#ga7b84b14e60f47812b581d1f93057c85a">More...</a><br/></td></tr>
<trclass="memitem:ga4a57a413a3cef286a7da6d4666575586"><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d0/dcb/group__kohonen__1d.html#ga4a57a413a3cef286a7da6d4666575586">kohonen_get_min_1d</a> (double const *X, int N, double *val, int *idx)</td></tr>
<trclass="memdesc:ga4a57a413a3cef286a7da6d4666575586"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Get minimum value and index of the value in a vector. <ahref="../../d0/dcb/group__kohonen__1d.html#ga4a57a413a3cef286a7da6d4666575586">More...</a><br/></td></tr>
<trclass="memitem:gae334493a0917a24736fe5ba82aa6f81f"><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d0/dcb/group__kohonen__1d.html#gae334493a0917a24736fe5ba82aa6f81f">kohonen_update_weights</a> (double const *x, double *const *W, double *D, int num_out, int num_features, double alpha, int R)</td></tr>
<trclass="memdesc:gae334493a0917a24736fe5ba82aa6f81f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Update weights of the SOM using Kohonen algorithm. <ahref="../../d0/dcb/group__kohonen__1d.html#gae334493a0917a24736fe5ba82aa6f81f">More...</a><br/></td></tr>
<trclass="memitem:gaeaeffbff2be4d5d15b0d4f10f846abde"><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d0/dcb/group__kohonen__1d.html#gaeaeffbff2be4d5d15b0d4f10f846abde">kohonen_som_tracer</a> (double **X, double *const *W, int num_samples, int num_features, int num_out, double alpha_min)</td></tr>
<trclass="memdesc:gaeaeffbff2be4d5d15b0d4f10f846abde"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Apply incremental algorithm with updating neighborhood and learning rates on all samples in the given datset. <ahref="../../d0/dcb/group__kohonen__1d.html#gaeaeffbff2be4d5d15b0d4f10f846abde">More...</a><br/></td></tr>
<divclass="line"><aid="l00108"name="l00108"></a><spanclass="lineno"> 108</span><spanclass="keywordflow">for</span> (<spanclass="keywordtype">int</span> i = 0; i < N; i++) <spanclass="comment">// check each value</span></div>
<divclass="line"><aid="l00110"name="l00110"></a><spanclass="lineno"> 110</span><spanclass="keywordflow">if</span> (X[i] < val[0]) <spanclass="comment">// if a lower value is found</span></div>
<divclass="line"><aid="l00111"name="l00111"></a><spanclass="lineno"> 111</span> { <spanclass="comment">// save the value and its index</span></div>
<divclass="line"><aid="l00182"name="l00182"></a><spanclass="lineno"> 182</span><spanclass="keywordtype">int</span> R = num_out >> 2, iter = 0;</div>
<divclass="line"><aid="l00189"name="l00189"></a><spanclass="lineno"> 189</span><spanclass="comment">// Loop for each sample pattern in the data set</span></div>
<divclass="line"><aid="l00193"name="l00193"></a><spanclass="lineno"> 193</span><spanclass="comment">// update weights for the current input pattern sample</span></div>
<divclass="line"><aid="l00197"name="l00197"></a><spanclass="lineno"> 197</span><spanclass="comment">// every 10th iteration, reduce the neighborhood range</span></div>
<divclass="ttc"id="agroup__kohonen__1d_html_gae334493a0917a24736fe5ba82aa6f81f"><divclass="ttname"><ahref="../../d0/dcb/group__kohonen__1d.html#gae334493a0917a24736fe5ba82aa6f81f">kohonen_update_weights</a></div><divclass="ttdeci">void kohonen_update_weights(double const *x, double *const *W, double *D, int num_out, int num_features, double alpha, int R)</div><divclass="ttdoc">Update weights of the SOM using Kohonen algorithm.</div><divclass="ttdef"><b>Definition:</b> kohonen_som_trace.c:129</div></div>
<divclass="ttc"id="amalloc__dbg_8h_html_a725f50ecaf1959d96de79b36b4788fee"><divclass="ttname"><ahref="../../d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee">malloc</a></div><divclass="ttdeci">#define malloc(bytes)</div><divclass="ttdoc">This macro replace the standard malloc function with malloc_dbg.</div><divclass="ttdef"><b>Definition:</b> malloc_dbg.h:18</div></div>
<divclass="ttc"id="amalloc__dbg_8h_html_a9cc854374299a1dd933bf62029761768"><divclass="ttname"><ahref="../../d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768">free</a></div><divclass="ttdeci">#define free(ptr)</div><divclass="ttdoc">This macro replace the standard free function with free_dbg.</div><divclass="ttdef"><b>Definition:</b> malloc_dbg.h:26</div></div>
<divclass="center"><iframescrolling="no"frameborder="0"src="../../d0/dcb/group__kohonen__1d_gaeaeffbff2be4d5d15b0d4f10f846abde_cgraph.svg"width="564"height="38"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
<divclass="line"><aid="l00141"name="l00141"></a><spanclass="lineno"> 141</span><spanclass="comment">// compute Euclidian distance of each output</span></div>
<divclass="line"><aid="l00142"name="l00142"></a><spanclass="lineno"> 142</span><spanclass="comment">// point from the current sample</span></div>
<divclass="line"><aid="l00143"name="l00143"></a><spanclass="lineno"> 143</span><spanclass="keywordflow">for</span> (k = 0; k < num_features; k++)</div>
<divclass="line"><aid="l00153"name="l00153"></a><spanclass="lineno"> 153</span><spanclass="comment">// step 3a: get the neighborhood range</span></div>
<divclass="line"><aid="l00157"name="l00157"></a><spanclass="lineno"> 157</span><spanclass="comment">// step 3b: update the weights of nodes in the</span></div>
<divclass="line"><aid="l00163"name="l00163"></a><spanclass="lineno"> 163</span><spanclass="keywordflow">for</span> (k = 0; k < num_features; k++)</div>
<divclass="line"><aid="l00164"name="l00164"></a><spanclass="lineno"> 164</span><spanclass="comment">// update weights of nodes in the neighborhood</span></div>
<divclass="ttc"id="agroup__kohonen__1d_html_ga4a57a413a3cef286a7da6d4666575586"><divclass="ttname"><ahref="../../d0/dcb/group__kohonen__1d.html#ga4a57a413a3cef286a7da6d4666575586">kohonen_get_min_1d</a></div><divclass="ttdeci">void kohonen_get_min_1d(double const *X, int N, double *val, int *idx)</div><divclass="ttdoc">Get minimum value and index of the value in a vector.</div><divclass="ttdef"><b>Definition:</b> kohonen_som_trace.c:104</div></div>
<divclass="ttc"id="agroup__kohonen__1d_html_gac6afabdc09a49a433ee19d8a9486056d"><divclass="ttname"><ahref="../../d0/dcb/group__kohonen__1d.html#gac6afabdc09a49a433ee19d8a9486056d">min</a></div><divclass="ttdeci">#define min(a, b)</div><divclass="ttdoc">shorthand for minimum value</div><divclass="ttdef"><b>Definition:</b> kohonen_som_trace.c:36</div></div>
<divclass="ttc"id="agroup__kohonen__1d_html_gaffe776513b24d84b39af8ab0930fef7f"><divclass="ttname"><ahref="../../d0/dcb/group__kohonen__1d.html#gaffe776513b24d84b39af8ab0930fef7f">max</a></div><divclass="ttdeci">#define max(a, b)</div><divclass="ttdoc">shorthand for maximum value</div><divclass="ttdef"><b>Definition:</b> kohonen_som_trace.c:32</div></div>
<divclass="center"><iframescrolling="no"frameborder="0"src="../../d0/dcb/group__kohonen__1d_gae334493a0917a24736fe5ba82aa6f81f_cgraph.svg"width="374"height="38"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
<divclass="line"><aid="l00082"name="l00082"></a><spanclass="lineno"> 82</span><spanclass="keywordflow">for</span> (<spanclass="keywordtype">int</span> i = 0; i < num_points; i++) <spanclass="comment">// for each point in the array</span></div>
<divclass="line"><aid="l00084"name="l00084"></a><spanclass="lineno"> 84</span><spanclass="keywordflow">for</span> (<spanclass="keywordtype">int</span> j = 0; j < num_features; j++) <spanclass="comment">// for each feature in the array</span></div>
<divclass="line"><aid="l00086"name="l00086"></a><spanclass="lineno"> 86</span> fprintf(fp, <spanclass="stringliteral">"%.4g"</span>, X[i][j]); <spanclass="comment">// print the feature value</span></div>
<divclass="line"><aid="l00087"name="l00087"></a><spanclass="lineno"> 87</span><spanclass="keywordflow">if</span> (j < num_features - 1) <spanclass="comment">// if not the last feature</span></div>
<divclass="line"><aid="l00090"name="l00090"></a><spanclass="lineno"> 90</span><spanclass="keywordflow">if</span> (i < num_points - 1) <spanclass="comment">// if not the last row</span></div>
<divclass="line"><aid="l00091"name="l00091"></a><spanclass="lineno"> 91</span> fprintf(fp, <spanclass="stringliteral">"\n"</span>); <spanclass="comment">// start a new line</span></div>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="../../doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.9.2 </li>