2020-07-04 02:15:35 +08:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2022-09-08 08:17:03 +08:00
< html xmlns = "http://www.w3.org/1999/xhtml" lang = "en-US" >
2020-07-04 02:15:35 +08:00
< head >
< meta http-equiv = "Content-Type" content = "text/xhtml;charset=UTF-8" / >
2021-10-26 03:34:27 +08:00
< meta http-equiv = "X-UA-Compatible" content = "IE=11" / >
2023-01-21 05:44:50 +08:00
< meta name = "generator" content = "Doxygen 1.9.6" / >
2020-07-04 02:15:35 +08:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
< title > Algorithms_in_C: Kohonen SOM topology algorithm< / title >
< link href = "../../tabs.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "../../jquery.js" > < / script >
< script type = "text/javascript" src = "../../dynsections.js" > < / script >
< link href = "../../navtree.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "../../resize.js" > < / script >
< script type = "text/javascript" src = "../../navtreedata.js" > < / script >
< script type = "text/javascript" src = "../../navtree.js" > < / script >
< link href = "../../search/search.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "../../search/searchdata.js" > < / script >
< script type = "text/javascript" src = "../../search/search.js" > < / script >
< script type = "text/x-mathjax-config" >
2021-10-26 03:34:27 +08:00
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
2020-07-04 02:15:35 +08:00
});
< / script >
< script type = "text/javascript" async = "async" src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js" > < / script >
< link href = "../../doxygen.css" rel = "stylesheet" type = "text/css" / >
< / head >
< body >
< div id = "top" > <!-- do not remove this div, it is closed by doxygen! -->
< div id = "titlearea" >
< table cellspacing = "0" cellpadding = "0" >
< tbody >
2022-01-15 04:11:27 +08:00
< tr id = "projectrow" >
< td id = "projectalign" >
2021-10-26 03:34:27 +08:00
< div id = "projectname" > Algorithms_in_C< span id = "projectnumber" >   1.0.0< / span >
2020-07-04 02:15:35 +08:00
< / div >
< div id = "projectbrief" > Set of algorithms implemented in C.< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
<!-- end header part -->
2023-01-21 05:44:50 +08:00
<!-- Generated by Doxygen 1.9.6 -->
2020-07-04 02:15:35 +08:00
< script type = "text/javascript" >
2021-10-26 03:34:27 +08:00
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
2022-09-08 08:17:03 +08:00
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
2020-07-04 02:15:35 +08:00
/* @license-end */
< / script >
< script type = "text/javascript" src = "../../menudata.js" > < / script >
< script type = "text/javascript" src = "../../menu.js" > < / script >
< script type = "text/javascript" >
2021-10-26 03:34:27 +08:00
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
2020-07-04 02:15:35 +08:00
$(function() {
initMenu('../../',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
2021-10-26 03:34:27 +08:00
/* @license-end */
< / script >
2020-07-04 02:15:35 +08:00
< div id = "main-nav" > < / div >
< / div > <!-- top -->
< div id = "side-nav" class = "ui-resizable side-nav-resizable" >
< div id = "nav-tree" >
< div id = "nav-tree-contents" >
< div id = "nav-sync" class = "sync" > < / div >
< / div >
< / div >
< div id = "splitbar" style = "-moz-user-select:none;"
class="ui-resizable-handle">
< / div >
< / div >
< script type = "text/javascript" >
2021-10-26 03:34:27 +08:00
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
2020-07-04 02:15:35 +08:00
$(document).ready(function(){initNavTree('d1/d6b/group__kohonen__2d.html','../../'); initResizable(); });
/* @license-end */
< / script >
< div id = "doc-content" >
<!-- window showing the filter options -->
< div id = "MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
< / div >
<!-- iframe showing the search results (closed by default) -->
< div id = "MSearchResultsWindow" >
2022-09-08 08:17:03 +08:00
< div id = "MSearchResults" >
< div class = "SRPage" >
< div id = "SRIndex" >
< div id = "SRResults" > < / div >
< div class = "SRStatus" id = "Loading" > Loading...< / div >
< div class = "SRStatus" id = "Searching" > Searching...< / div >
< div class = "SRStatus" id = "NoMatches" > No Matches< / div >
< / div >
< / div >
< / div >
2020-07-04 02:15:35 +08:00
< / div >
< div class = "header" >
< div class = "summary" >
< a href = "#nested-classes" > Data Structures< / a > |
< a href = "#define-members" > Macros< / a > |
< a href = "#func-members" > Functions< / a > < / div >
2021-10-26 03:34:27 +08:00
< div class = "headertitle" > < div class = "title" > Kohonen SOM topology algorithm< div class = "ingroups" > < a class = "el" href = "../../d9/d66/group__machine__learning.html" > Machine learning algorithms< / a > < / div > < / div > < / div >
2020-07-04 02:15:35 +08:00
< / div > <!-- header -->
< div class = "contents" >
< div class = "dynheader" >
Collaboration diagram for Kohonen SOM topology algorithm:< / div >
< div class = "dyncontent" >
2021-12-10 01:57:52 +08:00
< div class = "center" > < iframe scrolling = "no" frameborder = "0" src = "../../d1/d6b/group__kohonen__2d.svg" width = "403" height = "51" > < p > < b > This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.< / b > < / p > < / iframe >
2020-07-04 02:15:35 +08:00
< / div >
< / div >
< table class = "memberdecls" >
2021-10-26 03:34:27 +08:00
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a id = "nested-classes" name = "nested-classes" > < / a >
2020-07-04 02:15:35 +08:00
Data Structures< / h2 > < / td > < / tr >
< tr class = "memitem:" > < td class = "memItemLeft" align = "right" valign = "top" > struct   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d8/db8/structkohonen__array__3d.html" > kohonen_array_3d< / a > < / td > < / tr >
< tr class = "memdesc:" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > to store info regarding 3D arrays < a href = "../../d8/db8/structkohonen__array__3d.html#details" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table > < table class = "memberdecls" >
2021-10-26 03:34:27 +08:00
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a id = "define-members" name = "define-members" > < / a >
2020-07-04 02:15:35 +08:00
Macros< / h2 > < / td > < / tr >
2021-10-26 03:34:27 +08:00
< tr class = "memitem:gaffe776513b24d84b39af8ab0930fef7f" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "gaffe776513b24d84b39af8ab0930fef7f" name = "gaffe776513b24d84b39af8ab0930fef7f" > < / a >
#define  < / td > < td class = "memItemRight" valign = "bottom" > < b > max< / b > (a, b)      (((a) > (b)) ? (a) : (b))< / td > < / tr >
2020-07-04 02:15:35 +08:00
< tr class = "memdesc:gaffe776513b24d84b39af8ab0930fef7f" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > shorthand for maximum value < br / > < / td > < / tr >
< tr class = "separator:gaffe776513b24d84b39af8ab0930fef7f" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2021-10-26 03:34:27 +08:00
< tr class = "memitem:gac6afabdc09a49a433ee19d8a9486056d" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "gac6afabdc09a49a433ee19d8a9486056d" name = "gac6afabdc09a49a433ee19d8a9486056d" > < / a >
#define  < / td > < td class = "memItemRight" valign = "bottom" > < b > min< / b > (a, b)      (((a) < (b)) ? (a) : (b))< / td > < / tr >
2020-07-04 02:15:35 +08:00
< tr class = "memdesc:gac6afabdc09a49a433ee19d8a9486056d" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > shorthand for minimum value < br / > < / td > < / tr >
< tr class = "separator:gac6afabdc09a49a433ee19d8a9486056d" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table > < table class = "memberdecls" >
2021-10-26 03:34:27 +08:00
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a id = "func-members" name = "func-members" > < / a >
2020-07-04 02:15:35 +08:00
Functions< / h2 > < / td > < / tr >
2021-10-26 03:34:27 +08:00
< tr class = "memitem:gac78022076d889bf2ebfb2c41d4527ceb" > < td class = "memItemLeft" align = "right" valign = "top" > double *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d1/d6b/group__kohonen__2d.html#gac78022076d889bf2ebfb2c41d4527ceb" > kohonen_data_3d< / a > (const struct < a class = "el" href = "../../d8/db8/structkohonen__array__3d.html" > kohonen_array_3d< / a > *arr, int x, int y, int z)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:gac78022076d889bf2ebfb2c41d4527ceb" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Function that returns the pointer to (x, y, z) ^th location in the linear 3D array given by: < br / > < / td > < / tr >
2021-10-26 03:34:27 +08:00
< tr class = "separator:gac78022076d889bf2ebfb2c41d4527ceb" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2020-07-04 02:15:35 +08:00
< tr class = "memitem:gaf5ce14f026d6d231bef29161bac2b485" > < td class = "memItemLeft" align = "right" valign = "top" > double  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d1/d6b/group__kohonen__2d.html#gaf5ce14f026d6d231bef29161bac2b485" > _random< / a > (double a, double b)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:gaf5ce14f026d6d231bef29161bac2b485" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Helper function to generate a random number in a given interval. < br / > < / td > < / tr >
2020-07-04 02:15:35 +08:00
< tr class = "separator:gaf5ce14f026d6d231bef29161bac2b485" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga6824dc6d973eb3339af7aef5fea78b0c" > < td class = "memItemLeft" align = "right" valign = "top" > int  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d1/d6b/group__kohonen__2d.html#ga6824dc6d973eb3339af7aef5fea78b0c" > save_2d_data< / a > (const char *fname, double **X, int num_points, int num_features)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:ga6824dc6d973eb3339af7aef5fea78b0c" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Save a given n-dimensional data martix to file. < br / > < / td > < / tr >
2020-07-04 02:15:35 +08:00
< tr class = "separator:ga6824dc6d973eb3339af7aef5fea78b0c" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga49d35f68f5d11d8ef6f8cce0d0e7bcba" > < td class = "memItemLeft" align = "right" valign = "top" > int  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d1/d6b/group__kohonen__2d.html#ga49d35f68f5d11d8ef6f8cce0d0e7bcba" > save_u_matrix< / a > (const char *fname, struct < a class = "el" href = "../../d8/db8/structkohonen__array__3d.html" > kohonen_array_3d< / a > *W)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:ga49d35f68f5d11d8ef6f8cce0d0e7bcba" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Create the distance matrix or < a href = "https://en.wikipedia.org/wiki/U-matrix" target = "_blank" > U-matrix< / a > from the trained weights and save to disk. < br / > < / td > < / tr >
2020-07-04 02:15:35 +08:00
< tr class = "separator:ga49d35f68f5d11d8ef6f8cce0d0e7bcba" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2020-07-17 04:36:47 +08:00
< tr class = "memitem:gadc22d512c00a9f5799ee067f4fb90b4b" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d1/d6b/group__kohonen__2d.html#gadc22d512c00a9f5799ee067f4fb90b4b" > get_min_2d< / a > (double **X, int N, double *val, int *x_idx, int *y_idx)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:gadc22d512c00a9f5799ee067f4fb90b4b" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Get minimum value and index of the value in a matrix. < br / > < / td > < / tr >
2020-07-04 02:15:35 +08:00
< tr class = "separator:gadc22d512c00a9f5799ee067f4fb90b4b" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga83abb572c60d202e100595a989dfe123" > < td class = "memItemLeft" align = "right" valign = "top" > double  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d1/d6b/group__kohonen__2d.html#ga83abb572c60d202e100595a989dfe123" > kohonen_update_weights< / a > (const double *X, struct < a class = "el" href = "../../d8/db8/structkohonen__array__3d.html" > kohonen_array_3d< / a > *W, double **D, int num_out, int num_features, double alpha, int R)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:ga83abb572c60d202e100595a989dfe123" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Update weights of the SOM using Kohonen algorithm. < br / > < / td > < / tr >
2020-07-04 02:15:35 +08:00
< tr class = "separator:ga83abb572c60d202e100595a989dfe123" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gacb42eda8af6ebd6a141a34ab00a0b710" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d1/d6b/group__kohonen__2d.html#gacb42eda8af6ebd6a141a34ab00a0b710" > kohonen_som< / a > (double **X, struct < a class = "el" href = "../../d8/db8/structkohonen__array__3d.html" > kohonen_array_3d< / a > *W, int num_samples, int num_features, int num_out, double alpha_min)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:gacb42eda8af6ebd6a141a34ab00a0b710" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Apply incremental algorithm with updating neighborhood and learning rates on all samples in the given datset. < br / > < / td > < / tr >
2020-07-04 02:15:35 +08:00
< tr class = "separator:gacb42eda8af6ebd6a141a34ab00a0b710" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table >
< a name = "details" id = "details" > < / a > < h2 class = "groupheader" > Detailed Description< / h2 >
< h2 class = "groupheader" > Function Documentation< / h2 >
2021-10-26 03:34:27 +08:00
< a id = "gaf5ce14f026d6d231bef29161bac2b485" name = "gaf5ce14f026d6d231bef29161bac2b485" > < / a >
2022-09-08 08:17:03 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#gaf5ce14f026d6d231bef29161bac2b485" > ◆   < / a > < / span > _random()< / h2 >
2020-07-04 02:15:35 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > double _random < / td >
< td > (< / td >
< td class = "paramtype" > double  < / td >
< td class = "paramname" > < em > a< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > double  < / td >
< td class = "paramname" > < em > b< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Helper function to generate a random number in a given interval. < / p >
2023-01-21 05:44:50 +08:00
< p > < br / >
2020-07-04 02:15:35 +08:00
Steps:< / p > < ol type = "1" >
< li > < code > r1 = rand() % 100< / code > gets a random number between 0 and 99< / li >
< li > < code > r2 = r1 / 100< / code > converts random number to be between 0 and 0.99< / li >
2022-09-08 08:17:03 +08:00
< li > scale and offset the random number to given range of \([a,b)\) < p class = "formulaDsp" >
2022-06-08 02:13:03 +08:00
\[
y = (b - a) \times \frac{\text{(random number between 0 and RAND_MAX)} \;
\text{mod}\; 100}{100} + a \]
2020-07-04 02:15:35 +08:00
< / p >
< / li >
< / ol >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > a< / td > < td > lower limit < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > b< / td > < td > upper limit < / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > random number in the range \([a,b)\) < / dd > < / dl >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 88< / span > {< / div >
< div class = "line" > < span class = "lineno" > 89< / span > < span class = "keywordflow" > return< / span > ((b - a) * (rand() % 100) / 100.f) + a;< / div >
< div class = "line" > < span class = "lineno" > 90< / span > }< / div >
2020-07-04 02:15:35 +08:00
< / div > <!-- fragment -->
< / div >
< / div >
2021-10-26 03:34:27 +08:00
< a id = "gadc22d512c00a9f5799ee067f4fb90b4b" name = "gadc22d512c00a9f5799ee067f4fb90b4b" > < / a >
2022-09-08 08:17:03 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#gadc22d512c00a9f5799ee067f4fb90b4b" > ◆   < / a > < / span > get_min_2d()< / h2 >
2020-07-04 02:15:35 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > void get_min_2d < / td >
< td > (< / td >
< td class = "paramtype" > double **  < / td >
< td class = "paramname" > < em > X< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > N< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > double *  < / td >
< td class = "paramname" > < em > val< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int *  < / td >
< td class = "paramname" > < em > x_idx< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int *  < / td >
< td class = "paramname" > < em > y_idx< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Get minimum value and index of the value in a matrix. < / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > X< / td > < td > matrix to search < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > N< / td > < td > number of points in the vector < / td > < / tr >
< tr > < td class = "paramdir" > [out]< / td > < td class = "paramname" > val< / td > < td > minimum value found < / td > < / tr >
< tr > < td class = "paramdir" > [out]< / td > < td class = "paramname" > x_idx< / td > < td > x-index where minimum value was found < / td > < / tr >
< tr > < td class = "paramdir" > [out]< / td > < td class = "paramname" > y_idx< / td > < td > y-index where minimum value was found < / td > < / tr >
< / table >
< / dd >
< / dl >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 205< / span > {< / div >
< div class = "line" > < span class = "lineno" > 206< / span > val[0] = INFINITY; < span class = "comment" > // initial min value< / span > < / div >
< div class = "line" > < span class = "lineno" > 207< / span > < / div >
< div class = "line" > < span class = "lineno" > 208< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > i = 0; i < N; i++) < span class = "comment" > // traverse each x-index< / span > < / div >
< div class = "line" > < span class = "lineno" > 209< / span > {< / div >
< div class = "line" > < span class = "lineno" > 210< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > j = 0; j < N; j++) < span class = "comment" > // traverse each y-index< / span > < / div >
< div class = "line" > < span class = "lineno" > 211< / span > {< / div >
< div class = "line" > < span class = "lineno" > 212< / span > < span class = "keywordflow" > if< / span > (X[i][j] < val[0]) < span class = "comment" > // if a lower value is found< / span > < / div >
< div class = "line" > < span class = "lineno" > 213< / span > { < span class = "comment" > // save the value and its index< / span > < / div >
< div class = "line" > < span class = "lineno" > 214< / span > x_idx[0] = i;< / div >
< div class = "line" > < span class = "lineno" > 215< / span > y_idx[0] = j;< / div >
< div class = "line" > < span class = "lineno" > 216< / span > val[0] = X[i][j];< / div >
< div class = "line" > < span class = "lineno" > 217< / span > }< / div >
< div class = "line" > < span class = "lineno" > 218< / span > }< / div >
< div class = "line" > < span class = "lineno" > 219< / span > }< / div >
< div class = "line" > < span class = "lineno" > 220< / span > }< / div >
2020-07-04 02:15:35 +08:00
< / div > <!-- fragment -->
< / div >
< / div >
2021-10-26 03:34:27 +08:00
< a id = "gac78022076d889bf2ebfb2c41d4527ceb" name = "gac78022076d889bf2ebfb2c41d4527ceb" > < / a >
2022-09-08 08:17:03 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#gac78022076d889bf2ebfb2c41d4527ceb" > ◆   < / a > < / span > kohonen_data_3d()< / h2 >
2020-07-04 02:15:35 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2021-10-26 03:34:27 +08:00
< td class = "memname" > double * kohonen_data_3d < / td >
2020-07-04 02:15:35 +08:00
< td > (< / td >
< td class = "paramtype" > const struct < a class = "el" href = "../../d8/db8/structkohonen__array__3d.html" > kohonen_array_3d< / a > *  < / td >
< td class = "paramname" > < em > arr< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > x< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > y< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > z< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Function that returns the pointer to (x, y, z) ^th location in the linear 3D array given by: < / p >
< p class = "formulaDsp" >
2022-06-08 02:13:03 +08:00
\[
X_{i,j,k} = i\times M\times N + j\times N + k
\]
2020-07-04 02:15:35 +08:00
< / p >
< p > where \(L\), \(M\) and \(N\) are the 3D matrix dimensions. < / p > < dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > arr< / td > < td > pointer to < a class = "el" href = "../../d8/db8/structkohonen__array__3d.html" title = "to store info regarding 3D arrays" > kohonen_array_3d< / a > structure < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > x< / td > < td > first index < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > y< / td > < td > second index < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > z< / td > < td > third index < / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > pointer to (x,y,z)^th location of data < / dd > < / dl >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 68< / span > {< / div >
< div class = "line" > < span class = "lineno" > 69< / span > < span class = "keywordtype" > int< / span > offset = (x * arr-> < a class = "code hl_variable" href = "../../d8/db8/structkohonen__array__3d.html#a888d7e007b38c91c7933e12a9566af1d" > dim2< / a > * arr-> < a class = "code hl_variable" href = "../../d8/db8/structkohonen__array__3d.html#a160f14830bdfbbf9f422f382ee754dbf" > dim3< / a > ) + (y * arr-> < a class = "code hl_variable" href = "../../d8/db8/structkohonen__array__3d.html#a160f14830bdfbbf9f422f382ee754dbf" > dim3< / a > ) + z;< / div >
< div class = "line" > < span class = "lineno" > 70< / span > < span class = "keywordflow" > return< / span > arr-> < a class = "code hl_variable" href = "../../d8/db8/structkohonen__array__3d.html#ad546baa2e81c6196d5f1dc0fe2e5bd59" > data< / a > + offset;< / div >
< div class = "line" > < span class = "lineno" > 71< / span > }< / div >
2021-02-06 03:52:57 +08:00
< div class = "ttc" id = "astructkohonen__array__3d_html_a160f14830bdfbbf9f422f382ee754dbf" > < div class = "ttname" > < a href = "../../d8/db8/structkohonen__array__3d.html#a160f14830bdfbbf9f422f382ee754dbf" > kohonen_array_3d::dim3< / a > < / div > < div class = "ttdeci" > int dim3< / div > < div class = "ttdoc" > lengths of thirddimension< / div > < div class = "ttdef" > < b > Definition:< / b > kohonen_som_topology.c:51< / div > < / div >
< div class = "ttc" id = "astructkohonen__array__3d_html_a888d7e007b38c91c7933e12a9566af1d" > < div class = "ttname" > < a href = "../../d8/db8/structkohonen__array__3d.html#a888d7e007b38c91c7933e12a9566af1d" > kohonen_array_3d::dim2< / a > < / div > < div class = "ttdeci" > int dim2< / div > < div class = "ttdoc" > lengths of second dimension< / div > < div class = "ttdef" > < b > Definition:< / b > kohonen_som_topology.c:50< / div > < / div >
< div class = "ttc" id = "astructkohonen__array__3d_html_ad546baa2e81c6196d5f1dc0fe2e5bd59" > < div class = "ttname" > < a href = "../../d8/db8/structkohonen__array__3d.html#ad546baa2e81c6196d5f1dc0fe2e5bd59" > kohonen_array_3d::data< / a > < / div > < div class = "ttdeci" > double * data< / div > < div class = "ttdoc" > pointer to data< / div > < div class = "ttdef" > < b > Definition:< / b > kohonen_som_topology.c:52< / div > < / div >
2020-07-04 02:15:35 +08:00
< / div > <!-- fragment -->
< / div >
< / div >
2021-10-26 03:34:27 +08:00
< a id = "gacb42eda8af6ebd6a141a34ab00a0b710" name = "gacb42eda8af6ebd6a141a34ab00a0b710" > < / a >
2022-09-08 08:17:03 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#gacb42eda8af6ebd6a141a34ab00a0b710" > ◆   < / a > < / span > kohonen_som()< / h2 >
2020-07-04 02:15:35 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > void kohonen_som < / td >
< td > (< / td >
< td class = "paramtype" > double **  < / td >
< td class = "paramname" > < em > X< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > struct < a class = "el" href = "../../d8/db8/structkohonen__array__3d.html" > kohonen_array_3d< / a > *  < / td >
< td class = "paramname" > < em > W< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > num_samples< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > num_features< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > num_out< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > double  < / td >
< td class = "paramname" > < em > alpha_min< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Apply incremental algorithm with updating neighborhood and learning rates on all samples in the given datset. < / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > X< / td > < td > data set < / td > < / tr >
< tr > < td class = "paramdir" > [in,out]< / td > < td class = "paramname" > W< / td > < td > weights matrix < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > num_samples< / td > < td > number of output points < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > num_features< / td > < td > number of features per input sample < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > num_out< / td > < td > number of output points < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > alpha_min< / td > < td > terminal value of alpha < / td > < / tr >
< / table >
< / dd >
< / dl >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 316< / span > {< / div >
< div class = "line" > < span class = "lineno" > 317< / span > < span class = "keywordtype" > int< / span > R = num_out > > 2, iter = 0;< / div >
< div class = "line" > < span class = "lineno" > 318< / span > < span class = "keywordtype" > double< / span > **D = (< span class = "keywordtype" > double< / span > **)< a class = "code hl_define" href = "../../d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee" > malloc< / a > (num_out * < span class = "keyword" > sizeof< / span > (< span class = "keywordtype" > double< / span > *));< / div >
< div class = "line" > < span class = "lineno" > 319< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > i = 0; i < num_out; i++)< / div >
< div class = "line" > < span class = "lineno" > 320< / span > D[i] = (< span class = "keywordtype" > double< / span > *)< a class = "code hl_define" href = "../../d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee" > malloc< / a > (num_out * < span class = "keyword" > sizeof< / span > (< span class = "keywordtype" > double< / span > ));< / div >
< div class = "line" > < span class = "lineno" > 321< / span > < / div >
< div class = "line" > < span class = "lineno" > 322< / span > < span class = "keywordtype" > double< / span > dmin = 1.f; < span class = "comment" > // average minimum distance of all samples< / span > < / div >
< div class = "line" > < span class = "lineno" > 323< / span > < / div >
< div class = "line" > < span class = "lineno" > 324< / span > < span class = "comment" > // Loop alpha from 1 to slpha_min< / span > < / div >
< div class = "line" > < span class = "lineno" > 325< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > double< / span > alpha = 1.f; alpha > alpha_min & & dmin > 1e-3;< / div >
< div class = "line" > < span class = "lineno" > 326< / span > alpha -= 0.001, iter++)< / div >
< div class = "line" > < span class = "lineno" > 327< / span > {< / div >
< div class = "line" > < span class = "lineno" > 328< / span > dmin = 0.f;< / div >
< div class = "line" > < span class = "lineno" > 329< / span > < span class = "comment" > // Loop for each sample pattern in the data set< / span > < / div >
< div class = "line" > < span class = "lineno" > 330< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > sample = 0; sample < num_samples; sample++)< / div >
< div class = "line" > < span class = "lineno" > 331< / span > {< / div >
< div class = "line" > < span class = "lineno" > 332< / span > < span class = "comment" > // update weights for the current input pattern sample< / span > < / div >
< div class = "line" > < span class = "lineno" > 333< / span > dmin += < a class = "code hl_function" href = "../../d1/d6b/group__kohonen__2d.html#ga83abb572c60d202e100595a989dfe123" > kohonen_update_weights< / a > (X[sample], W, D, num_out,< / div >
< div class = "line" > < span class = "lineno" > 334< / span > num_features, alpha, R);< / div >
< div class = "line" > < span class = "lineno" > 335< / span > }< / div >
< div class = "line" > < span class = "lineno" > 336< / span > < / div >
< div class = "line" > < span class = "lineno" > 337< / span > < span class = "comment" > // every 20th iteration, reduce the neighborhood range< / span > < / div >
< div class = "line" > < span class = "lineno" > 338< / span > < span class = "keywordflow" > if< / span > (iter % 100 == 0 & & R > 1)< / div >
< div class = "line" > < span class = "lineno" > 339< / span > R--;< / div >
< div class = "line" > < span class = "lineno" > 340< / span > < / div >
< div class = "line" > < span class = "lineno" > 341< / span > dmin /= num_samples;< / div >
< div class = "line" > < span class = "lineno" > 342< / span > printf(< span class = "stringliteral" > " iter: %5d\t alpha: %.4g\t R: %d\td_min: %.4g\r" < / span > , iter, alpha, R,< / div >
< div class = "line" > < span class = "lineno" > 343< / span > dmin);< / div >
< div class = "line" > < span class = "lineno" > 344< / span > }< / div >
< div class = "line" > < span class = "lineno" > 345< / span > putchar(< span class = "charliteral" > ' \n' < / span > );< / div >
< div class = "line" > < span class = "lineno" > 346< / span > < / div >
< div class = "line" > < span class = "lineno" > 347< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > i = 0; i < num_out; i++) < a class = "code hl_define" href = "../../d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768" > free< / a > (D[i]);< / div >
< div class = "line" > < span class = "lineno" > 348< / span > < a class = "code hl_define" href = "../../d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768" > free< / a > (D);< / div >
< div class = "line" > < span class = "lineno" > 349< / span > }< / div >
2021-02-06 03:52:57 +08:00
< div class = "ttc" id = "agroup__kohonen__2d_html_ga83abb572c60d202e100595a989dfe123" > < div class = "ttname" > < a href = "../../d1/d6b/group__kohonen__2d.html#ga83abb572c60d202e100595a989dfe123" > kohonen_update_weights< / a > < / div > < div class = "ttdeci" > double kohonen_update_weights(const double *X, struct kohonen_array_3d *W, double **D, int num_out, int num_features, double alpha, int R)< / div > < div class = "ttdoc" > Update weights of the SOM using Kohonen algorithm.< / div > < div class = "ttdef" > < b > Definition:< / b > kohonen_som_topology.c:234< / div > < / div >
2021-02-18 06:41:16 +08:00
< div class = "ttc" id = "amalloc__dbg_8h_html_a725f50ecaf1959d96de79b36b4788fee" > < div class = "ttname" > < a href = "../../d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee" > malloc< / a > < / div > < div class = "ttdeci" > #define malloc(bytes)< / div > < div class = "ttdoc" > This macro replace the standard malloc function with malloc_dbg.< / div > < div class = "ttdef" > < b > Definition:< / b > malloc_dbg.h:18< / div > < / div >
< div class = "ttc" id = "amalloc__dbg_8h_html_a9cc854374299a1dd933bf62029761768" > < div class = "ttname" > < a href = "../../d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768" > free< / a > < / div > < div class = "ttdeci" > #define free(ptr)< / div > < div class = "ttdoc" > This macro replace the standard free function with free_dbg.< / div > < div class = "ttdef" > < b > Definition:< / b > malloc_dbg.h:26< / div > < / div >
2020-07-04 02:15:35 +08:00
< / div > <!-- fragment --> < div class = "dynheader" >
Here is the call graph for this function:< / div >
< div class = "dyncontent" >
2022-09-08 08:17:03 +08:00
< div class = "center" > < iframe scrolling = "no" frameborder = "0" src = "../../d1/d6b/group__kohonen__2d_gacb42eda8af6ebd6a141a34ab00a0b710_cgraph.svg" width = "503" height = "86" > < p > < b > This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.< / b > < / p > < / iframe >
2020-07-04 02:15:35 +08:00
< / div >
< / div >
< / div >
< / div >
2021-10-26 03:34:27 +08:00
< a id = "ga83abb572c60d202e100595a989dfe123" name = "ga83abb572c60d202e100595a989dfe123" > < / a >
2022-09-08 08:17:03 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#ga83abb572c60d202e100595a989dfe123" > ◆   < / a > < / span > kohonen_update_weights()< / h2 >
2020-07-04 02:15:35 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > double kohonen_update_weights < / td >
< td > (< / td >
< td class = "paramtype" > const double *  < / td >
< td class = "paramname" > < em > X< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > struct < a class = "el" href = "../../d8/db8/structkohonen__array__3d.html" > kohonen_array_3d< / a > *  < / td >
< td class = "paramname" > < em > W< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > double **  < / td >
< td class = "paramname" > < em > D< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > num_out< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > num_features< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > double  < / td >
< td class = "paramname" > < em > alpha< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > R< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Update weights of the SOM using Kohonen algorithm. < / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > X< / td > < td > data point < / td > < / tr >
< tr > < td class = "paramdir" > [in,out]< / td > < td class = "paramname" > W< / td > < td > weights matrix < / td > < / tr >
< tr > < td class = "paramdir" > [in,out]< / td > < td class = "paramname" > D< / td > < td > temporary vector to store distances < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > num_out< / td > < td > number of output points < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > num_features< / td > < td > number of features per input sample < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > alpha< / td > < td > learning rate \(0< \alpha\le1\) < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > R< / td > < td > neighborhood range < / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > minimum distance of sample and trained weights < / dd > < / dl >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 237< / span > {< / div >
< div class = "line" > < span class = "lineno" > 238< / span > < span class = "keywordtype" > int< / span > x, y, k;< / div >
< div class = "line" > < span class = "lineno" > 239< / span > < span class = "keywordtype" > double< / span > d_min = 0.f;< / div >
< div class = "line" > < span class = "lineno" > 240< / span > < / div >
< div class = "line" > < span class = "lineno" > 241< / span > < span class = "preprocessor" > #ifdef _OPENMP< / span > < / div >
< div class = "line" > < span class = "lineno" > 242< / span > < span class = "preprocessor" > #pragma omp for< / span > < / div >
< div class = "line" > < span class = "lineno" > 243< / span > < span class = "preprocessor" > #endif< / span > < / div >
< div class = "line" > < span class = "lineno" > 244< / span > < span class = "comment" > // step 1: for each 2D output point< / span > < / div >
< div class = "line" > < span class = "lineno" > 245< / span > < span class = "keywordflow" > for< / span > (x = 0; x < num_out; x++)< / div >
< div class = "line" > < span class = "lineno" > 246< / span > {< / div >
< div class = "line" > < span class = "lineno" > 247< / span > < span class = "keywordflow" > for< / span > (y = 0; y < num_out; y++)< / div >
< div class = "line" > < span class = "lineno" > 248< / span > {< / div >
< div class = "line" > < span class = "lineno" > 249< / span > D[x][y] = 0.f;< / div >
< div class = "line" > < span class = "lineno" > 250< / span > < span class = "comment" > // compute Euclidian distance of each output< / span > < / div >
< div class = "line" > < span class = "lineno" > 251< / span > < span class = "comment" > // point from the current sample< / span > < / div >
< div class = "line" > < span class = "lineno" > 252< / span > < span class = "keywordflow" > for< / span > (k = 0; k < num_features; k++)< / div >
< div class = "line" > < span class = "lineno" > 253< / span > {< / div >
< div class = "line" > < span class = "lineno" > 254< / span > < span class = "keywordtype" > double< / span > *w = < a class = "code hl_function" href = "../../d1/d6b/group__kohonen__2d.html#gac78022076d889bf2ebfb2c41d4527ceb" > kohonen_data_3d< / a > (W, x, y, k);< / div >
< div class = "line" > < span class = "lineno" > 255< / span > D[x][y] += (w[0] - X[k]) * (w[0] - X[k]);< / div >
< div class = "line" > < span class = "lineno" > 256< / span > }< / div >
< div class = "line" > < span class = "lineno" > 257< / span > D[x][y] = sqrt(D[x][y]);< / div >
< div class = "line" > < span class = "lineno" > 258< / span > }< / div >
< div class = "line" > < span class = "lineno" > 259< / span > }< / div >
< div class = "line" > < span class = "lineno" > 260< / span > < / div >
< div class = "line" > < span class = "lineno" > 261< / span > < span class = "comment" > // step 2: get closest node i.e., node with smallest Euclidian distance to< / span > < / div >
< div class = "line" > < span class = "lineno" > 262< / span > < span class = "comment" > // the current pattern< / span > < / div >
< div class = "line" > < span class = "lineno" > 263< / span > < span class = "keywordtype" > int< / span > d_min_x, d_min_y;< / div >
< div class = "line" > < span class = "lineno" > 264< / span > < a class = "code hl_function" href = "../../d1/d6b/group__kohonen__2d.html#gadc22d512c00a9f5799ee067f4fb90b4b" > get_min_2d< / a > (D, num_out, & d_min, & d_min_x, & d_min_y);< / div >
< div class = "line" > < span class = "lineno" > 265< / span > < / div >
< div class = "line" > < span class = "lineno" > 266< / span > < span class = "comment" > // step 3a: get the neighborhood range< / span > < / div >
< div class = "line" > < span class = "lineno" > 267< / span > < span class = "keywordtype" > int< / span > from_x = < a class = "code hl_define" href = "../../d1/d6b/group__kohonen__2d.html#gaffe776513b24d84b39af8ab0930fef7f" > max< / a > (0, d_min_x - R);< / div >
< div class = "line" > < span class = "lineno" > 268< / span > < span class = "keywordtype" > int< / span > to_x = < a class = "code hl_define" href = "../../d1/d6b/group__kohonen__2d.html#gac6afabdc09a49a433ee19d8a9486056d" > min< / a > (num_out, d_min_x + R + 1);< / div >
< div class = "line" > < span class = "lineno" > 269< / span > < span class = "keywordtype" > int< / span > from_y = < a class = "code hl_define" href = "../../d1/d6b/group__kohonen__2d.html#gaffe776513b24d84b39af8ab0930fef7f" > max< / a > (0, d_min_y - R);< / div >
< div class = "line" > < span class = "lineno" > 270< / span > < span class = "keywordtype" > int< / span > to_y = < a class = "code hl_define" href = "../../d1/d6b/group__kohonen__2d.html#gac6afabdc09a49a433ee19d8a9486056d" > min< / a > (num_out, d_min_y + R + 1);< / div >
< div class = "line" > < span class = "lineno" > 271< / span > < / div >
< div class = "line" > < span class = "lineno" > 272< / span > < span class = "comment" > // step 3b: update the weights of nodes in the< / span > < / div >
< div class = "line" > < span class = "lineno" > 273< / span > < span class = "comment" > // neighborhood< / span > < / div >
< div class = "line" > < span class = "lineno" > 274< / span > < span class = "preprocessor" > #ifdef _OPENMP< / span > < / div >
< div class = "line" > < span class = "lineno" > 275< / span > < span class = "preprocessor" > #pragma omp for< / span > < / div >
< div class = "line" > < span class = "lineno" > 276< / span > < span class = "preprocessor" > #endif< / span > < / div >
< div class = "line" > < span class = "lineno" > 277< / span > < span class = "keywordflow" > for< / span > (x = from_x; x < to_x; x++)< / div >
< div class = "line" > < span class = "lineno" > 278< / span > {< / div >
< div class = "line" > < span class = "lineno" > 279< / span > < span class = "keywordflow" > for< / span > (y = from_y; y < to_y; y++)< / div >
< div class = "line" > < span class = "lineno" > 280< / span > {< / div >
< div class = "line" > < span class = "lineno" > 281< / span > < span class = "comment" > /* you can enable the following normalization if needed.< / span > < / div >
< div class = "line" > < span class = "lineno" > 282< / span > < span class = "comment" > personally, I found it detrimental to convergence */< / span > < / div >
< div class = "line" > < span class = "lineno" > 283< / span > < span class = "comment" > // const double s2pi = sqrt(2.f * M_PI);< / span > < / div >
< div class = "line" > < span class = "lineno" > 284< / span > < span class = "comment" > // double normalize = 1.f / (alpha * s2pi);< / span > < / div >
< div class = "line" > < span class = "lineno" > 285< / span > < / div >
< div class = "line" > < span class = "lineno" > 286< / span > < span class = "comment" > /* apply scaling inversely proportional to distance from the< / span > < / div >
< div class = "line" > < span class = "lineno" > 287< / span > < span class = "comment" > current node */< / span > < / div >
< div class = "line" > < span class = "lineno" > 288< / span > < span class = "keywordtype" > double< / span > d2 =< / div >
< div class = "line" > < span class = "lineno" > 289< / span > (d_min_x - x) * (d_min_x - x) + (d_min_y - y) * (d_min_y - y);< / div >
< div class = "line" > < span class = "lineno" > 290< / span > < span class = "keywordtype" > double< / span > scale_factor = exp(-d2 / (2.f * alpha * alpha));< / div >
< div class = "line" > < span class = "lineno" > 291< / span > < / div >
< div class = "line" > < span class = "lineno" > 292< / span > < span class = "keywordflow" > for< / span > (k = 0; k < num_features; k++)< / div >
< div class = "line" > < span class = "lineno" > 293< / span > {< / div >
< div class = "line" > < span class = "lineno" > 294< / span > < span class = "keywordtype" > double< / span > *w = < a class = "code hl_function" href = "../../d1/d6b/group__kohonen__2d.html#gac78022076d889bf2ebfb2c41d4527ceb" > kohonen_data_3d< / a > (W, x, y, k);< / div >
< div class = "line" > < span class = "lineno" > 295< / span > < span class = "comment" > // update weights of nodes in the neighborhood< / span > < / div >
< div class = "line" > < span class = "lineno" > 296< / span > w[0] += alpha * scale_factor * (X[k] - w[0]);< / div >
< div class = "line" > < span class = "lineno" > 297< / span > }< / div >
< div class = "line" > < span class = "lineno" > 298< / span > }< / div >
< div class = "line" > < span class = "lineno" > 299< / span > }< / div >
< div class = "line" > < span class = "lineno" > 300< / span > < span class = "keywordflow" > return< / span > d_min;< / div >
< div class = "line" > < span class = "lineno" > 301< / span > }< / div >
2021-02-06 03:52:57 +08:00
< div class = "ttc" id = "agroup__kohonen__2d_html_gac6afabdc09a49a433ee19d8a9486056d" > < div class = "ttname" > < a href = "../../d1/d6b/group__kohonen__2d.html#gac6afabdc09a49a433ee19d8a9486056d" > min< / a > < / div > < div class = "ttdeci" > #define min(a, b)< / div > < div class = "ttdoc" > shorthand for minimum value< / div > < div class = "ttdef" > < b > Definition:< / b > kohonen_som_topology.c:43< / div > < / div >
2021-10-26 03:34:27 +08:00
< div class = "ttc" id = "agroup__kohonen__2d_html_gac78022076d889bf2ebfb2c41d4527ceb" > < div class = "ttname" > < a href = "../../d1/d6b/group__kohonen__2d.html#gac78022076d889bf2ebfb2c41d4527ceb" > kohonen_data_3d< / a > < / div > < div class = "ttdeci" > double * kohonen_data_3d(const struct kohonen_array_3d *arr, int x, int y, int z)< / div > < div class = "ttdoc" > Function that returns the pointer to (x, y, z) ^th location in the linear 3D array given by:< / div > < div class = "ttdef" > < b > Definition:< / b > kohonen_som_topology.c:67< / div > < / div >
2021-02-06 03:52:57 +08:00
< div class = "ttc" id = "agroup__kohonen__2d_html_gadc22d512c00a9f5799ee067f4fb90b4b" > < div class = "ttname" > < a href = "../../d1/d6b/group__kohonen__2d.html#gadc22d512c00a9f5799ee067f4fb90b4b" > get_min_2d< / a > < / div > < div class = "ttdeci" > void get_min_2d(double **X, int N, double *val, int *x_idx, int *y_idx)< / div > < div class = "ttdoc" > Get minimum value and index of the value in a matrix.< / div > < div class = "ttdef" > < b > Definition:< / b > kohonen_som_topology.c:204< / div > < / div >
< div class = "ttc" id = "agroup__kohonen__2d_html_gaffe776513b24d84b39af8ab0930fef7f" > < div class = "ttname" > < a href = "../../d1/d6b/group__kohonen__2d.html#gaffe776513b24d84b39af8ab0930fef7f" > max< / a > < / div > < div class = "ttdeci" > #define max(a, b)< / div > < div class = "ttdoc" > shorthand for maximum value< / div > < div class = "ttdef" > < b > Definition:< / b > kohonen_som_topology.c:39< / div > < / div >
2020-07-04 02:15:35 +08:00
< / div > <!-- fragment --> < div class = "dynheader" >
Here is the call graph for this function:< / div >
< div class = "dyncontent" >
2022-09-08 08:17:03 +08:00
< div class = "center" > < iframe scrolling = "no" frameborder = "0" src = "../../d1/d6b/group__kohonen__2d_ga83abb572c60d202e100595a989dfe123_cgraph.svg" width = "352" height = "86" > < p > < b > This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.< / b > < / p > < / iframe >
2020-07-04 02:15:35 +08:00
< / div >
< / div >
< / div >
< / div >
2021-10-26 03:34:27 +08:00
< a id = "ga6824dc6d973eb3339af7aef5fea78b0c" name = "ga6824dc6d973eb3339af7aef5fea78b0c" > < / a >
2022-09-08 08:17:03 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#ga6824dc6d973eb3339af7aef5fea78b0c" > ◆   < / a > < / span > save_2d_data()< / h2 >
2020-07-04 02:15:35 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > int save_2d_data < / td >
< td > (< / td >
< td class = "paramtype" > const char *  < / td >
< td class = "paramname" > < em > fname< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > double **  < / td >
< td class = "paramname" > < em > X< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > num_points< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > num_features< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Save a given n-dimensional data martix to file. < / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > fname< / td > < td > filename to save in (gets overwritten without confirmation) < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > X< / td > < td > matrix to save < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > num_points< / td > < td > rows in the matrix = number of points < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > num_features< / td > < td > columns in the matrix = dimensions of points < / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > 0 if all ok < / dd >
< dd >
-1 if file creation failed < / dd > < / dl >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 104< / span > {< / div >
< div class = "line" > < span class = "lineno" > 105< / span > FILE *fp = fopen(fname, < span class = "stringliteral" > " wt" < / span > );< / div >
< div class = "line" > < span class = "lineno" > 106< / span > < span class = "keywordflow" > if< / span > (!fp) < span class = "comment" > // error with fopen< / span > < / div >
< div class = "line" > < span class = "lineno" > 107< / span > {< / div >
< div class = "line" > < span class = "lineno" > 108< / span > < span class = "keywordtype" > char< / span > msg[120];< / div >
< div class = "line" > < span class = "lineno" > 109< / span > sprintf(msg, < span class = "stringliteral" > " File error (%s): " < / span > , fname);< / div >
< div class = "line" > < span class = "lineno" > 110< / span > perror(msg);< / div >
< div class = "line" > < span class = "lineno" > 111< / span > < span class = "keywordflow" > return< / span > -1;< / div >
< div class = "line" > < span class = "lineno" > 112< / span > }< / div >
< div class = "line" > < span class = "lineno" > 113< / span > < / div >
< div class = "line" > < span class = "lineno" > 114< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > i = 0; i < num_points; i++) < span class = "comment" > // for each point in the array< / span > < / div >
< div class = "line" > < span class = "lineno" > 115< / span > {< / div >
< div class = "line" > < span class = "lineno" > 116< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > j = 0; j < num_features; j++) < span class = "comment" > // for each feature in the array< / span > < / div >
< div class = "line" > < span class = "lineno" > 117< / span > {< / div >
< div class = "line" > < span class = "lineno" > 118< / span > fprintf(fp, < span class = "stringliteral" > " %.4g" < / span > , X[i][j]); < span class = "comment" > // print the feature value< / span > < / div >
< div class = "line" > < span class = "lineno" > 119< / span > < span class = "keywordflow" > if< / span > (j < num_features - 1) < span class = "comment" > // if not the last feature< / span > < / div >
< div class = "line" > < span class = "lineno" > 120< / span > fputc(< span class = "charliteral" > ' ,' < / span > , fp); < span class = "comment" > // suffix comma< / span > < / div >
< div class = "line" > < span class = "lineno" > 121< / span > }< / div >
< div class = "line" > < span class = "lineno" > 122< / span > < span class = "keywordflow" > if< / span > (i < num_points - 1) < span class = "comment" > // if not the last row< / span > < / div >
< div class = "line" > < span class = "lineno" > 123< / span > fputc(< span class = "charliteral" > ' \n' < / span > , fp); < span class = "comment" > // start a new line< / span > < / div >
< div class = "line" > < span class = "lineno" > 124< / span > }< / div >
< div class = "line" > < span class = "lineno" > 125< / span > fclose(fp);< / div >
< div class = "line" > < span class = "lineno" > 126< / span > < span class = "keywordflow" > return< / span > 0;< / div >
< div class = "line" > < span class = "lineno" > 127< / span > }< / div >
2020-07-04 02:15:35 +08:00
< / div > <!-- fragment -->
< / div >
< / div >
2021-10-26 03:34:27 +08:00
< a id = "ga49d35f68f5d11d8ef6f8cce0d0e7bcba" name = "ga49d35f68f5d11d8ef6f8cce0d0e7bcba" > < / a >
2022-09-08 08:17:03 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#ga49d35f68f5d11d8ef6f8cce0d0e7bcba" > ◆   < / a > < / span > save_u_matrix()< / h2 >
2020-07-04 02:15:35 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > int save_u_matrix < / td >
< td > (< / td >
< td class = "paramtype" > const char *  < / td >
< td class = "paramname" > < em > fname< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > struct < a class = "el" href = "../../d8/db8/structkohonen__array__3d.html" > kohonen_array_3d< / a > *  < / td >
< td class = "paramname" > < em > W< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2021-10-26 03:34:27 +08:00
< p > Create the distance matrix or < a href = "https://en.wikipedia.org/wiki/U-matrix" target = "_blank" > U-matrix< / a > from the trained weights and save to disk. < / p >
2020-07-04 02:15:35 +08:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > fname< / td > < td > filename to save in (gets overwriten without confirmation) < / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > W< / td > < td > model matrix to save < / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > 0 if all ok < / dd >
< dd >
-1 if file creation failed < / dd > < / dl >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 140< / span > {< / div >
< div class = "line" > < span class = "lineno" > 141< / span > FILE *fp = fopen(fname, < span class = "stringliteral" > " wt" < / span > );< / div >
< div class = "line" > < span class = "lineno" > 142< / span > < span class = "keywordflow" > if< / span > (!fp) < span class = "comment" > // error with fopen< / span > < / div >
< div class = "line" > < span class = "lineno" > 143< / span > {< / div >
< div class = "line" > < span class = "lineno" > 144< / span > < span class = "keywordtype" > char< / span > msg[120];< / div >
< div class = "line" > < span class = "lineno" > 145< / span > sprintf(msg, < span class = "stringliteral" > " File error (%s): " < / span > , fname);< / div >
< div class = "line" > < span class = "lineno" > 146< / span > perror(msg);< / div >
< div class = "line" > < span class = "lineno" > 147< / span > < span class = "keywordflow" > return< / span > -1;< / div >
< div class = "line" > < span class = "lineno" > 148< / span > }< / div >
< div class = "line" > < span class = "lineno" > 149< / span > < / div >
< div class = "line" > < span class = "lineno" > 150< / span > < span class = "keywordtype" > int< / span > R = < a class = "code hl_define" href = "../../d1/d6b/group__kohonen__2d.html#gaffe776513b24d84b39af8ab0930fef7f" > max< / a > (W-> < a class = "code hl_variable" href = "../../d8/db8/structkohonen__array__3d.html#a16720581653fa9a34d1029e7229a7377" > dim1< / a > > > 3, 2); < span class = "comment" > /* neighborhood range */< / span > < / div >
< div class = "line" > < span class = "lineno" > 151< / span > < / div >
< div class = "line" > < span class = "lineno" > 152< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > i = 0; i < W-> < a class = "code hl_variable" href = "../../d8/db8/structkohonen__array__3d.html#a16720581653fa9a34d1029e7229a7377" > dim1< / a > ; i++) < span class = "comment" > // for each x< / span > < / div >
< div class = "line" > < span class = "lineno" > 153< / span > {< / div >
< div class = "line" > < span class = "lineno" > 154< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > j = 0; j < W-> < a class = "code hl_variable" href = "../../d8/db8/structkohonen__array__3d.html#a888d7e007b38c91c7933e12a9566af1d" > dim2< / a > ; j++) < span class = "comment" > // for each y< / span > < / div >
< div class = "line" > < span class = "lineno" > 155< / span > {< / div >
< div class = "line" > < span class = "lineno" > 156< / span > < span class = "keywordtype" > double< / span > distance = 0.f;< / div >
< div class = "line" > < span class = "lineno" > 157< / span > < span class = "keywordtype" > int< / span > k;< / div >
< div class = "line" > < span class = "lineno" > 158< / span > < / div >
< div class = "line" > < span class = "lineno" > 159< / span > < span class = "keywordtype" > int< / span > from_x = < a class = "code hl_define" href = "../../d1/d6b/group__kohonen__2d.html#gaffe776513b24d84b39af8ab0930fef7f" > max< / a > (0, i - R);< / div >
< div class = "line" > < span class = "lineno" > 160< / span > < span class = "keywordtype" > int< / span > to_x = < a class = "code hl_define" href = "../../d1/d6b/group__kohonen__2d.html#gac6afabdc09a49a433ee19d8a9486056d" > min< / a > (W-> < a class = "code hl_variable" href = "../../d8/db8/structkohonen__array__3d.html#a16720581653fa9a34d1029e7229a7377" > dim1< / a > , i + R + 1);< / div >
< div class = "line" > < span class = "lineno" > 161< / span > < span class = "keywordtype" > int< / span > from_y = < a class = "code hl_define" href = "../../d1/d6b/group__kohonen__2d.html#gaffe776513b24d84b39af8ab0930fef7f" > max< / a > (0, j - R);< / div >
< div class = "line" > < span class = "lineno" > 162< / span > < span class = "keywordtype" > int< / span > to_y = < a class = "code hl_define" href = "../../d1/d6b/group__kohonen__2d.html#gac6afabdc09a49a433ee19d8a9486056d" > min< / a > (W-> < a class = "code hl_variable" href = "../../d8/db8/structkohonen__array__3d.html#a888d7e007b38c91c7933e12a9566af1d" > dim2< / a > , j + R + 1);< / div >
< div class = "line" > < span class = "lineno" > 163< / span > < span class = "keywordtype" > int< / span > l;< / div >
< div class = "line" > < span class = "lineno" > 164< / span > < span class = "preprocessor" > #ifdef _OPENMP< / span > < / div >
< div class = "line" > < span class = "lineno" > 165< / span > < span class = "preprocessor" > #pragma omp parallel for reduction(+ : distance)< / span > < / div >
< div class = "line" > < span class = "lineno" > 166< / span > < span class = "preprocessor" > #endif< / span > < / div >
< div class = "line" > < span class = "lineno" > 167< / span > < span class = "keywordflow" > for< / span > (l = from_x; l < to_x; l++) < span class = "comment" > // scan neighborhoor in x< / span > < / div >
< div class = "line" > < span class = "lineno" > 168< / span > {< / div >
< div class = "line" > < span class = "lineno" > 169< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > m = from_y; m < to_y; m++) < span class = "comment" > // scan neighborhood in y< / span > < / div >
< div class = "line" > < span class = "lineno" > 170< / span > {< / div >
< div class = "line" > < span class = "lineno" > 171< / span > < span class = "keywordtype" > double< / span > d = 0.f;< / div >
< div class = "line" > < span class = "lineno" > 172< / span > < span class = "keywordflow" > for< / span > (k = 0; k < W-> < a class = "code hl_variable" href = "../../d8/db8/structkohonen__array__3d.html#a160f14830bdfbbf9f422f382ee754dbf" > dim3< / a > ; k++) < span class = "comment" > // for each feature< / span > < / div >
< div class = "line" > < span class = "lineno" > 173< / span > {< / div >
< div class = "line" > < span class = "lineno" > 174< / span > < span class = "keywordtype" > double< / span > *w1 = < a class = "code hl_function" href = "../../d1/d6b/group__kohonen__2d.html#gac78022076d889bf2ebfb2c41d4527ceb" > kohonen_data_3d< / a > (W, i, j, k);< / div >
< div class = "line" > < span class = "lineno" > 175< / span > < span class = "keywordtype" > double< / span > *w2 = < a class = "code hl_function" href = "../../d1/d6b/group__kohonen__2d.html#gac78022076d889bf2ebfb2c41d4527ceb" > kohonen_data_3d< / a > (W, l, m, k);< / div >
< div class = "line" > < span class = "lineno" > 176< / span > d += (w1[0] - w2[0]) * (w1[0] - w2[0]);< / div >
< div class = "line" > < span class = "lineno" > 177< / span > < span class = "comment" > // distance += w1[0] * w1[0];< / span > < / div >
< div class = "line" > < span class = "lineno" > 178< / span > }< / div >
< div class = "line" > < span class = "lineno" > 179< / span > distance += sqrt(d);< / div >
< div class = "line" > < span class = "lineno" > 180< / span > < span class = "comment" > // distance += d;< / span > < / div >
< div class = "line" > < span class = "lineno" > 181< / span > }< / div >
< div class = "line" > < span class = "lineno" > 182< / span > }< / div >
< div class = "line" > < span class = "lineno" > 183< / span > < / div >
< div class = "line" > < span class = "lineno" > 184< / span > distance /= R * R; < span class = "comment" > // mean distance from neighbors< / span > < / div >
< div class = "line" > < span class = "lineno" > 185< / span > fprintf(fp, < span class = "stringliteral" > " %.4g" < / span > , distance); < span class = "comment" > // print the mean separation< / span > < / div >
< div class = "line" > < span class = "lineno" > 186< / span > < span class = "keywordflow" > if< / span > (j < W-> dim2 - 1) < span class = "comment" > // if not the last column< / span > < / div >
< div class = "line" > < span class = "lineno" > 187< / span > fputc(< span class = "charliteral" > ' ,' < / span > , fp); < span class = "comment" > // suffix comma< / span > < / div >
< div class = "line" > < span class = "lineno" > 188< / span > }< / div >
< div class = "line" > < span class = "lineno" > 189< / span > < span class = "keywordflow" > if< / span > (i < W-> dim1 - 1) < span class = "comment" > // if not the last row< / span > < / div >
< div class = "line" > < span class = "lineno" > 190< / span > fputc(< span class = "charliteral" > ' \n' < / span > , fp); < span class = "comment" > // start a new line< / span > < / div >
< div class = "line" > < span class = "lineno" > 191< / span > }< / div >
< div class = "line" > < span class = "lineno" > 192< / span > fclose(fp);< / div >
< div class = "line" > < span class = "lineno" > 193< / span > < span class = "keywordflow" > return< / span > 0;< / div >
< div class = "line" > < span class = "lineno" > 194< / span > }< / div >
2021-02-06 03:52:57 +08:00
< div class = "ttc" id = "astructkohonen__array__3d_html_a16720581653fa9a34d1029e7229a7377" > < div class = "ttname" > < a href = "../../d8/db8/structkohonen__array__3d.html#a16720581653fa9a34d1029e7229a7377" > kohonen_array_3d::dim1< / a > < / div > < div class = "ttdeci" > int dim1< / div > < div class = "ttdoc" > lengths of first dimension< / div > < div class = "ttdef" > < b > Definition:< / b > kohonen_som_topology.c:49< / div > < / div >
2020-07-04 02:15:35 +08:00
< / div > <!-- fragment --> < div class = "dynheader" >
Here is the call graph for this function:< / div >
< div class = "dyncontent" >
2022-09-08 08:17:03 +08:00
< div class = "center" > < iframe scrolling = "no" frameborder = "0" src = "../../d1/d6b/group__kohonen__2d_ga49d35f68f5d11d8ef6f8cce0d0e7bcba_cgraph.svg" width = "290" height = "36" > < p > < b > This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.< / b > < / p > < / iframe >
2020-07-04 02:15:35 +08:00
< / div >
< / div >
< / div >
< / div >
< / div > <!-- contents -->
< / div > <!-- doc - content -->
<!-- start footer part -->
< div id = "nav-path" class = "navpath" > <!-- id is needed for treeview function! -->
< ul >
2023-01-21 05:44:50 +08:00
< li class = "footer" > Generated by < a href = "https://www.doxygen.org/index.html" > < img class = "footer" src = "../../doxygen.svg" width = "104" height = "31" alt = "doxygen" / > < / a > 1.9.6 < / li >
2020-07-04 02:15:35 +08:00
< / ul >
< / div >
< / body >
< / html >