ai4r 1.5 → 1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. data/examples/clusterers/simple_website_clustering.rb +47 -0
  2. data/lib/ai4r.rb +7 -0
  3. data/lib/ai4r/classifiers/hyperpipes.rb +118 -0
  4. data/lib/ai4r/clusterers/average_linkage.rb +22 -23
  5. data/lib/ai4r/clusterers/centroid_linkage.rb +66 -0
  6. data/lib/ai4r/clusterers/complete_linkage.rb +17 -12
  7. data/lib/ai4r/clusterers/diana.rb +139 -0
  8. data/lib/ai4r/clusterers/median_linkage.rb +61 -0
  9. data/lib/ai4r/clusterers/single_linkage.rb +57 -42
  10. data/lib/ai4r/clusterers/ward_linkage.rb +64 -0
  11. data/lib/ai4r/clusterers/weighted_average_linkage.rb +61 -0
  12. data/lib/ai4r/data/constants.rb +18 -0
  13. data/lib/ai4r/data/data_set.rb +5 -3
  14. data/lib/ai4r/data/proximity.rb +18 -0
  15. data/test/clusterers/average_linkage_test.rb +14 -11
  16. data/test/clusterers/bisecting_k_means_test.rb +9 -0
  17. data/test/clusterers/centroid_linkage_test.rb +50 -0
  18. data/test/clusterers/complete_linkage_test.rb +14 -5
  19. data/test/clusterers/diana_test.rb +69 -0
  20. data/test/clusterers/k_means_test.rb +9 -0
  21. data/test/clusterers/median_linkage_test.rb +50 -0
  22. data/test/clusterers/single_linkage_test.rb +15 -6
  23. data/test/clusterers/ward_linkage_test.rb +50 -0
  24. data/test/clusterers/weighted_average_linkage_test.rb +50 -0
  25. data/test/data/data_set_test.rb +14 -0
  26. data/test/data/proximity_test.rb +10 -0
  27. metadata +87 -298
  28. data/site/build/site/en/broken-links.xml +0 -2
  29. data/site/build/site/en/build/tmp/build-info.xml +0 -5
  30. data/site/build/site/en/build/tmp/plugins-1.xml +0 -212
  31. data/site/build/site/en/build/tmp/plugins-2.xml +0 -252
  32. data/site/build/site/en/build/tmp/projfilters.properties +0 -41
  33. data/site/build/site/en/downloads.html +0 -200
  34. data/site/build/site/en/downloads.pdf +0 -151
  35. data/site/build/site/en/geneticAlgorithms.html +0 -591
  36. data/site/build/site/en/geneticAlgorithms.pdf +0 -934
  37. data/site/build/site/en/images/ai4r-logo.png +0 -0
  38. data/site/build/site/en/images/built-with-forrest-button.png +0 -0
  39. data/site/build/site/en/images/c.png +0 -0
  40. data/site/build/site/en/images/c_wbn.png +0 -0
  41. data/site/build/site/en/images/c_wn.png +0 -0
  42. data/site/build/site/en/images/ero.gif +0 -0
  43. data/site/build/site/en/images/europe2.png +0 -0
  44. data/site/build/site/en/images/europe3.png +0 -0
  45. data/site/build/site/en/images/fitness.png +0 -0
  46. data/site/build/site/en/images/genetic_algorithms_example.png +0 -0
  47. data/site/build/site/en/images/instruction_arrow.png +0 -0
  48. data/site/build/site/en/images/jadeferret.png +0 -0
  49. data/site/build/site/en/images/my_email.png +0 -0
  50. data/site/build/site/en/images/neural_network_example.png +0 -0
  51. data/site/build/site/en/images/rubyforge.png +0 -0
  52. data/site/build/site/en/images/s.png +0 -0
  53. data/site/build/site/en/images/s_wbn.png +0 -0
  54. data/site/build/site/en/images/s_wn.png +0 -0
  55. data/site/build/site/en/images/sigmoid.png +0 -0
  56. data/site/build/site/en/images/t.png +0 -0
  57. data/site/build/site/en/images/t_wbn.png +0 -0
  58. data/site/build/site/en/images/t_wn.png +0 -0
  59. data/site/build/site/en/index.html +0 -390
  60. data/site/build/site/en/index.pdf +0 -657
  61. data/site/build/site/en/linkmap.html +0 -261
  62. data/site/build/site/en/linkmap.pdf +0 -94
  63. data/site/build/site/en/locationmap.xml +0 -72
  64. data/site/build/site/en/machineLearning.html +0 -340
  65. data/site/build/site/en/machineLearning.pdf +0 -337
  66. data/site/build/site/en/neuralNetworks.html +0 -521
  67. data/site/build/site/en/neuralNetworks.pdf +0 -671
  68. data/site/build/site/en/skin/CommonMessages_de.xml +0 -23
  69. data/site/build/site/en/skin/CommonMessages_en_US.xml +0 -23
  70. data/site/build/site/en/skin/CommonMessages_es.xml +0 -23
  71. data/site/build/site/en/skin/CommonMessages_fr.xml +0 -23
  72. data/site/build/site/en/skin/basic.css +0 -166
  73. data/site/build/site/en/skin/breadcrumbs-optimized.js +0 -90
  74. data/site/build/site/en/skin/breadcrumbs.js +0 -237
  75. data/site/build/site/en/skin/fontsize.js +0 -166
  76. data/site/build/site/en/skin/getBlank.js +0 -40
  77. data/site/build/site/en/skin/getMenu.js +0 -45
  78. data/site/build/site/en/skin/images/README.txt +0 -1
  79. data/site/build/site/en/skin/images/add.jpg +0 -0
  80. data/site/build/site/en/skin/images/built-with-forrest-button.png +0 -0
  81. data/site/build/site/en/skin/images/chapter.gif +0 -0
  82. data/site/build/site/en/skin/images/chapter_open.gif +0 -0
  83. data/site/build/site/en/skin/images/current.gif +0 -0
  84. data/site/build/site/en/skin/images/error.png +0 -0
  85. data/site/build/site/en/skin/images/external-link.gif +0 -0
  86. data/site/build/site/en/skin/images/fix.jpg +0 -0
  87. data/site/build/site/en/skin/images/forrest-credit-logo.png +0 -0
  88. data/site/build/site/en/skin/images/hack.jpg +0 -0
  89. data/site/build/site/en/skin/images/header_white_line.gif +0 -0
  90. data/site/build/site/en/skin/images/info.png +0 -0
  91. data/site/build/site/en/skin/images/instruction_arrow.png +0 -0
  92. data/site/build/site/en/skin/images/label.gif +0 -0
  93. data/site/build/site/en/skin/images/page.gif +0 -0
  94. data/site/build/site/en/skin/images/pdfdoc.gif +0 -0
  95. data/site/build/site/en/skin/images/poddoc.png +0 -0
  96. data/site/build/site/en/skin/images/printer.gif +0 -0
  97. data/site/build/site/en/skin/images/rc-b-l-15-1body-2menu-3menu.png +0 -0
  98. data/site/build/site/en/skin/images/rc-b-r-15-1body-2menu-3menu.png +0 -0
  99. data/site/build/site/en/skin/images/rc-b-r-5-1header-2tab-selected-3tab-selected.png +0 -0
  100. data/site/build/site/en/skin/images/rc-t-l-5-1header-2searchbox-3searchbox.png +0 -0
  101. data/site/build/site/en/skin/images/rc-t-l-5-1header-2tab-selected-3tab-selected.png +0 -0
  102. data/site/build/site/en/skin/images/rc-t-l-5-1header-2tab-unselected-3tab-unselected.png +0 -0
  103. data/site/build/site/en/skin/images/rc-t-r-15-1body-2menu-3menu.png +0 -0
  104. data/site/build/site/en/skin/images/rc-t-r-5-1header-2searchbox-3searchbox.png +0 -0
  105. data/site/build/site/en/skin/images/rc-t-r-5-1header-2tab-selected-3tab-selected.png +0 -0
  106. data/site/build/site/en/skin/images/rc-t-r-5-1header-2tab-unselected-3tab-unselected.png +0 -0
  107. data/site/build/site/en/skin/images/remove.jpg +0 -0
  108. data/site/build/site/en/skin/images/rss.png +0 -0
  109. data/site/build/site/en/skin/images/spacer.gif +0 -0
  110. data/site/build/site/en/skin/images/success.png +0 -0
  111. data/site/build/site/en/skin/images/txtdoc.png +0 -0
  112. data/site/build/site/en/skin/images/update.jpg +0 -0
  113. data/site/build/site/en/skin/images/valid-html401.png +0 -0
  114. data/site/build/site/en/skin/images/vcss.png +0 -0
  115. data/site/build/site/en/skin/images/warning.png +0 -0
  116. data/site/build/site/en/skin/images/xmldoc.gif +0 -0
  117. data/site/build/site/en/skin/menu.js +0 -48
  118. data/site/build/site/en/skin/note.txt +0 -50
  119. data/site/build/site/en/skin/print.css +0 -54
  120. data/site/build/site/en/skin/profile.css +0 -163
  121. data/site/build/site/en/skin/prototype.js +0 -1257
  122. data/site/build/site/en/skin/screen.css +0 -587
  123. data/site/build/site/en/sourceCode.html +0 -244
  124. data/site/build/site/en/sourceCode.pdf +0 -278
  125. data/site/build/site/en/svn.html +0 -244
  126. data/site/build/site/en/svn.pdf +0 -278
  127. data/site/build/tmp/brokenlinks.xml +0 -2
  128. data/site/build/tmp/build-info.xml +0 -5
  129. data/site/build/tmp/cocoon-work/cache-dir/cocoon-ehcache-1.data +0 -0
  130. data/site/build/tmp/cocoon-work/cache-dir/cocoon-ehcache-1.index +0 -0
  131. data/site/build/tmp/input.xmap +0 -32
  132. data/site/build/tmp/internal.xmap +0 -32
  133. data/site/build/tmp/locationmap.xml +0 -29
  134. data/site/build/tmp/output.xmap +0 -38
  135. data/site/build/tmp/pluginlist2fetchbuild.xml +0 -144
  136. data/site/build/tmp/plugins-1.xml +0 -201
  137. data/site/build/tmp/plugins-2.xml +0 -401
  138. data/site/build/tmp/projfilters.properties +0 -41
  139. data/site/build/tmp/resources.xmap +0 -32
  140. data/site/build/webapp/WEB-INF/logs/access.log +0 -0
  141. data/site/build/webapp/WEB-INF/logs/core.log +0 -775
  142. data/site/build/webapp/WEB-INF/logs/debug.log +0 -0
  143. data/site/build/webapp/WEB-INF/logs/error.log +0 -213
  144. data/site/build/webapp/WEB-INF/logs/flow.log +0 -0
  145. data/site/build/webapp/WEB-INF/logs/idgen.log +0 -0
  146. data/site/build/webapp/WEB-INF/logs/linkrewriter.log +0 -0
  147. data/site/build/webapp/WEB-INF/logs/locationmap.log +0 -0
  148. data/site/build/webapp/WEB-INF/logs/sitemap.log +0 -0
  149. data/site/build/webapp/WEB-INF/logs/xmlform.log +0 -0
  150. data/site/forrest.properties +0 -152
  151. data/site/forrest.properties.dispatcher.properties +0 -25
  152. data/site/forrest.properties.xml +0 -29
  153. data/site/src/documentation/README.txt +0 -7
  154. data/site/src/documentation/classes/CatalogManager.properties +0 -62
  155. data/site/src/documentation/content/locationmap.xml +0 -72
  156. data/site/src/documentation/content/xdocs/downloads.html +0 -9
  157. data/site/src/documentation/content/xdocs/geneticAlgorithms.xml +0 -294
  158. data/site/src/documentation/content/xdocs/index.xml +0 -129
  159. data/site/src/documentation/content/xdocs/machineLearning.xml +0 -131
  160. data/site/src/documentation/content/xdocs/neuralNetworks.xml +0 -270
  161. data/site/src/documentation/content/xdocs/site.xml +0 -54
  162. data/site/src/documentation/content/xdocs/sourceCode.xml +0 -43
  163. data/site/src/documentation/content/xdocs/tabs.xml +0 -35
  164. data/site/src/documentation/resources/images/ai4r-logo.png +0 -0
  165. data/site/src/documentation/resources/images/c.png +0 -0
  166. data/site/src/documentation/resources/images/c_wbn.png +0 -0
  167. data/site/src/documentation/resources/images/c_wn.png +0 -0
  168. data/site/src/documentation/resources/images/ellipse-2.svg +0 -30
  169. data/site/src/documentation/resources/images/ero.gif +0 -0
  170. data/site/src/documentation/resources/images/europe2.png +0 -0
  171. data/site/src/documentation/resources/images/europe3.png +0 -0
  172. data/site/src/documentation/resources/images/fitness.png +0 -0
  173. data/site/src/documentation/resources/images/genetic_algorithms_example.png +0 -0
  174. data/site/src/documentation/resources/images/icon-a.png +0 -0
  175. data/site/src/documentation/resources/images/icon-b.png +0 -0
  176. data/site/src/documentation/resources/images/icon.png +0 -0
  177. data/site/src/documentation/resources/images/jadeferret.png +0 -0
  178. data/site/src/documentation/resources/images/my_email.png +0 -0
  179. data/site/src/documentation/resources/images/neural_network_example.png +0 -0
  180. data/site/src/documentation/resources/images/project-logo.png +0 -0
  181. data/site/src/documentation/resources/images/rubyforge.png +0 -0
  182. data/site/src/documentation/resources/images/s.png +0 -0
  183. data/site/src/documentation/resources/images/s_wbn.png +0 -0
  184. data/site/src/documentation/resources/images/s_wn.png +0 -0
  185. data/site/src/documentation/resources/images/sigmoid.png +0 -0
  186. data/site/src/documentation/resources/images/sub-dir/icon-c.png +0 -0
  187. data/site/src/documentation/resources/images/t.png +0 -0
  188. data/site/src/documentation/resources/images/t_wbn.png +0 -0
  189. data/site/src/documentation/resources/images/t_wn.png +0 -0
  190. data/site/src/documentation/resources/schema/catalog.xcat +0 -29
  191. data/site/src/documentation/resources/schema/hello-v10.dtd +0 -51
  192. data/site/src/documentation/resources/schema/symbols-project-v10.ent +0 -26
  193. data/site/src/documentation/resources/stylesheets/hello2document.xsl +0 -33
  194. data/site/src/documentation/sitemap.xmap +0 -66
  195. data/site/src/documentation/skinconf.xml +0 -418
  196. data/site/src/documentation/translations/langcode.xml +0 -29
  197. data/site/src/documentation/translations/languages_de.xml +0 -24
  198. data/site/src/documentation/translations/languages_en.xml +0 -24
  199. data/site/src/documentation/translations/languages_es.xml +0 -22
  200. data/site/src/documentation/translations/languages_fr.xml +0 -24
  201. data/site/src/documentation/translations/languages_nl.xml +0 -24
  202. data/site/src/documentation/translations/menu.xml +0 -33
  203. data/site/src/documentation/translations/menu_af.xml +0 -33
  204. data/site/src/documentation/translations/menu_de.xml +0 -33
  205. data/site/src/documentation/translations/menu_es.xml +0 -33
  206. data/site/src/documentation/translations/menu_fr.xml +0 -33
  207. data/site/src/documentation/translations/menu_it.xml +0 -33
  208. data/site/src/documentation/translations/menu_nl.xml +0 -33
  209. data/site/src/documentation/translations/menu_no.xml +0 -33
  210. data/site/src/documentation/translations/menu_ru.xml +0 -33
  211. data/site/src/documentation/translations/menu_sk.xml +0 -33
  212. data/site/src/documentation/translations/tabs.xml +0 -22
  213. data/site/src/documentation/translations/tabs_de.xml +0 -22
  214. data/site/src/documentation/translations/tabs_es.xml +0 -22
  215. data/site/src/documentation/translations/tabs_fr.xml +0 -22
  216. data/site/src/documentation/translations/tabs_nl.xml +0 -22
@@ -1,337 +0,0 @@
1
- %PDF-1.3
2
- %����
3
- 4 0 obj
4
- << /Type /Info
5
- /Producer (FOP 0.20.5) >>
6
- endobj
7
- 5 0 obj
8
- << /Length 672 /Filter [ /ASCII85Decode /FlateDecode ]
9
- >>
10
- stream
11
- GauI49lo#B&;KZQ'fs3*X%9O-Rq$-S9JY_Vf!i'mJJ[@GZ)B5%o'blT_2:&e-O4Ark`o1!mGhL@4:?$B+V>;t,hiI'qca;a'EKS_rGaUYk2M3E0MY3J,Msh@[GI3,9Z_XDV![1&'.?eGFb)?`9=mW8Ii"ihK6>k3\t5',,^XcV$kMlqbQ'K0YH2aAjfgeWrATXfE-M0e?SY5&%qFcqXfDB;Z<Nd]%?B&O[SY`@lq\8>0)]c:3eo;_-lMr&hc`.Im^N)EpU)k>5HJ]Dp?>tcEU3r?6</^t/\p2,oU9+VBi!i\e$+1.1(iO\=A4F,98lg=XI%*-"RFLS+],$9Mn6/_=X]:i"+Sg<n%ZG$F5c'Z*2_;$k+"ek/A7l'LW0A(44<1!J>0DF;&=74$HT]JK=,+VL:OSs<M`^PLOSodGRab8*<U="eFNt*),4C5d5V3RqA/*C[*H?Y.JG5KqF+$GW2bIg$LPSBcTie8?H#?R)S8Q%3#BneWJss]C8DI7V2n.6;9Stg#Wia=e^3rf18>?$l/dE=JmWq)l+bH4,rCa$I%=YE87I*cK$V9GCI[:lO3poPOn<r3:DfY!P0?6B*LRFaIl(`A[FcM6$cu6P`Y)6X_%`_8]dU]^h7UXn#F0Y<D#qY,kPM]f;"Wps/]p<\jq2Wk@K-KD[['/~>
12
- endstream
13
- endobj
14
- 6 0 obj
15
- << /Type /Page
16
- /Parent 1 0 R
17
- /MediaBox [ 0 0 612 792 ]
18
- /Resources 3 0 R
19
- /Contents 5 0 R
20
- /Annots 7 0 R
21
- >>
22
- endobj
23
- 7 0 obj
24
- [
25
- 8 0 R
26
- 10 0 R
27
- 12 0 R
28
- 14 0 R
29
- 16 0 R
30
- ]
31
- endobj
32
- 8 0 obj
33
- << /Type /Annot
34
- /Subtype /Link
35
- /Rect [ 102.0 532.666 252.992 520.666 ]
36
- /C [ 0 0 0 ]
37
- /Border [ 0 0 0 ]
38
- /A 9 0 R
39
- /H /I
40
- >>
41
- endobj
42
- 10 0 obj
43
- << /Type /Annot
44
- /Subtype /Link
45
- /Rect [ 102.0 514.466 442.28 502.466 ]
46
- /C [ 0 0 0 ]
47
- /Border [ 0 0 0 ]
48
- /A 11 0 R
49
- /H /I
50
- >>
51
- endobj
52
- 12 0 obj
53
- << /Type /Annot
54
- /Subtype /Link
55
- /Rect [ 102.0 496.266 201.32 484.266 ]
56
- /C [ 0 0 0 ]
57
- /Border [ 0 0 0 ]
58
- /A 13 0 R
59
- /H /I
60
- >>
61
- endobj
62
- 14 0 obj
63
- << /Type /Annot
64
- /Subtype /Link
65
- /Rect [ 102.0 478.066 254.312 466.066 ]
66
- /C [ 0 0 0 ]
67
- /Border [ 0 0 0 ]
68
- /A 15 0 R
69
- /H /I
70
- >>
71
- endobj
72
- 16 0 obj
73
- << /Type /Annot
74
- /Subtype /Link
75
- /Rect [ 102.0 459.866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120
- << /Type /Page
121
- /Parent 1 0 R
122
- /MediaBox [ 0 0 612 792 ]
123
- /Resources 3 0 R
124
- /Contents 22 0 R
125
- /Annots 24 0 R
126
- >>
127
- endobj
128
- 24 0 obj
129
- [
130
- 25 0 R
131
- 26 0 R
132
- ]
133
- endobj
134
- 25 0 obj
135
- << /Type /Annot
136
- /Subtype /Link
137
- /Rect [ 90.0 619.806 259.296 607.806 ]
138
- /C [ 0 0 0 ]
139
- /Border [ 0 0 0 ]
140
- /A << /URI (http://en.wikipedia.org/wiki/Decision_tree)
141
- /S /URI >>
142
- /H /I
143
- >>
144
- endobj
145
- 26 0 obj
146
- << /Type /Annot
147
- /Subtype /Link
148
- /Rect [ 262.296 619.806 434.94 607.806 ]
149
- /C [ 0 0 0 ]
150
- /Border [ 0 0 0 ]
151
- /A << /URI (http://en.wikipedia.org/wiki/ID3_algorithm)
152
- /S /URI >>
153
- /H /I
154
- >>
155
- endobj
156
- 28 0 obj
157
- <<
158
- /Title (\376\377\0\61\0\40\0\111\0\156\0\164\0\162\0\157\0\144\0\165\0\143\0\164\0\151\0\157\0\156\0\40\0\164\0\157\0\40\0\111\0\104\0\63\0\40\0\141\0\154\0\147\0\157\0\162\0\151\0\164\0\150\0\155)
159
- /Parent 27 0 R
160
- /Next 29 0 R
161
- /A 9 0 R
162
- >> endobj
163
- 29 0 obj
164
- <<
165
- /Title (\376\377\0\62\0\40\0\115\0\141\0\162\0\153\0\145\0\164\0\151\0\156\0\147\0\40\0\164\0\141\0\162\0\147\0\145\0\164\0\40\0\163\0\164\0\162\0\141\0\164\0\145\0\147\0\171\0\40\0\145\0\170\0\141\0\155\0\160\0\154\0\145\0\40\0\165\0\163\0\151\0\156\0\147\0\40\0\111\0\104\0\63\0\40\0\104\0\145\0\143\0\151\0\163\0\151\0\157\0\156\0\40\0\124\0\162\0\145\0\145\0\163\0\40\0\151\0\156\0\40\0\122\0\165\0\142\0\171)
166
- /Parent 27 0 R
167
- /Prev 28 0 R
168
- /Next 30 0 R
169
- /A 11 0 R
170
- >> endobj
171
- 30 0 obj
172
- <<
173
- /Title (\376\377\0\63\0\40\0\102\0\145\0\164\0\164\0\145\0\162\0\40\0\144\0\141\0\164\0\141\0\40\0\154\0\157\0\141\0\144\0\151\0\156\0\147)
174
- /Parent 27 0 R
175
- /Prev 29 0 R
176
- /Next 31 0 R
177
- /A 13 0 R
178
- >> endobj
179
- 31 0 obj
180
- <<
181
- /Title (\376\377\0\64\0\40\0\101\0\40\0\147\0\157\0\157\0\144\0\40\0\164\0\151\0\160\0\40\0\146\0\157\0\162\0\40\0\144\0\141\0\164\0\141\0\40\0\145\0\166\0\141\0\154\0\165\0\141\0\164\0\151\0\157\0\156)
182
- /Parent 27 0 R
183
- /Prev 30 0 R
184
- /Next 32 0 R
185
- /A 15 0 R
186
- >> endobj
187
- 32 0 obj
188
- <<
189
- /Title (\376\377\0\65\0\40\0\115\0\157\0\162\0\145\0\40\0\141\0\142\0\157\0\165\0\164\0\40\0\111\0\104\0\63\0\40\0\141\0\156\0\144\0\40\0\144\0\145\0\143\0\151\0\163\0\151\0\157\0\156\0\40\0\164\0\162\0\145\0\145\0\163)
190
- /Parent 27 0 R
191
- /Prev 31 0 R
192
- /A 17 0 R
193
- >> endobj
194
- 33 0 obj
195
- << /Type /Font
196
- /Subtype /Type1
197
- /Name /F3
198
- /BaseFont /Helvetica-Bold
199
- /Encoding /WinAnsiEncoding >>
200
- endobj
201
- 34 0 obj
202
- << /Type /Font
203
- /Subtype /Type1
204
- /Name /F5
205
- /BaseFont /Times-Roman
206
- /Encoding /WinAnsiEncoding >>
207
- endobj
208
- 35 0 obj
209
- << /Type /Font
210
- /Subtype /Type1
211
- /Name /F1
212
- /BaseFont /Helvetica
213
- /Encoding /WinAnsiEncoding >>
214
- endobj
215
- 36 0 obj
216
- << /Type /Font
217
- /Subtype /Type1
218
- /Name /F9
219
- /BaseFont /Courier
220
- /Encoding /WinAnsiEncoding >>
221
- endobj
222
- 37 0 obj
223
- << /Type /Font
224
- /Subtype /Type1
225
- /Name /F2
226
- /BaseFont /Helvetica-Oblique
227
- /Encoding /WinAnsiEncoding >>
228
- endobj
229
- 38 0 obj
230
- << /Type /Font
231
- /Subtype /Type1
232
- /Name /F7
233
- /BaseFont /Times-Bold
234
- /Encoding /WinAnsiEncoding >>
235
- endobj
236
- 1 0 obj
237
- << /Type /Pages
238
- /Count 4
239
- /Kids [6 0 R 19 0 R 21 0 R 23 0 R ] >>
240
- endobj
241
- 2 0 obj
242
- << /Type /Catalog
243
- /Pages 1 0 R
244
- /Outlines 27 0 R
245
- /PageMode /UseOutlines
246
- >>
247
- endobj
248
- 3 0 obj
249
- <<
250
- /Font << /F3 33 0 R /F5 34 0 R /F1 35 0 R /F9 36 0 R /F2 37 0 R /F7 38 0 R >>
251
- /ProcSet [ /PDF /ImageC /Text ] >>
252
- endobj
253
- 9 0 obj
254
- <<
255
- /S /GoTo
256
- /D [19 0 R /XYZ 85.0 659.0 null]
257
- >>
258
- endobj
259
- 11 0 obj
260
- <<
261
- /S /GoTo
262
- /D [19 0 R /XYZ 85.0 519.466 null]
263
- >>
264
- endobj
265
- 13 0 obj
266
- <<
267
- /S /GoTo
268
- /D [21 0 R /XYZ 85.0 501.24 null]
269
- >>
270
- endobj
271
- 15 0 obj
272
- <<
273
- /S /GoTo
274
- /D [21 0 R /XYZ 85.0 337.106 null]
275
- >>
276
- endobj
277
- 17 0 obj
278
- <<
279
- /S /GoTo
280
- /D [23 0 R /XYZ 85.0 649.14 null]
281
- >>
282
- endobj
283
- 27 0 obj
284
- <<
285
- /First 28 0 R
286
- /Last 32 0 R
287
- >> endobj
288
- xref
289
- 0 39
290
- 0000000000 65535 f
291
- 0000009548 00000 n
292
- 0000009627 00000 n
293
- 0000009719 00000 n
294
- 0000000015 00000 n
295
- 0000000071 00000 n
296
- 0000000834 00000 n
297
- 0000000954 00000 n
298
- 0000001007 00000 n
299
- 0000009853 00000 n
300
- 0000001142 00000 n
301
- 0000009916 00000 n
302
- 0000001278 00000 n
303
- 0000009982 00000 n
304
- 0000001414 00000 n
305
- 0000010047 00000 n
306
- 0000001551 00000 n
307
- 0000010113 00000 n
308
- 0000001688 00000 n
309
- 0000003674 00000 n
310
- 0000003782 00000 n
311
- 0000005677 00000 n
312
- 0000005785 00000 n
313
- 0000006805 00000 n
314
- 0000006928 00000 n
315
- 0000006962 00000 n
316
- 0000007155 00000 n
317
- 0000010178 00000 n
318
- 0000007350 00000 n
319
- 0000007611 00000 n
320
- 0000008103 00000 n
321
- 0000008321 00000 n
322
- 0000008602 00000 n
323
- 0000008886 00000 n
324
- 0000008999 00000 n
325
- 0000009109 00000 n
326
- 0000009217 00000 n
327
- 0000009323 00000 n
328
- 0000009439 00000 n
329
- trailer
330
- <<
331
- /Size 39
332
- /Root 2 0 R
333
- /Info 4 0 R
334
- >>
335
- startxref
336
- 10229
337
- %%EOF
@@ -1,521 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
- <html>
3
- <head>
4
- <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
- <meta content="Apache Forrest" name="Generator">
6
- <meta name="Forrest-version" content="0.8">
7
- <meta name="Forrest-skin-name" content="pelt">
8
- <title>OCR example using Backpropagation networks in ruby :: ai4r</title>
9
- <link type="text/css" href="skin/basic.css" rel="stylesheet">
10
- <link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
11
- <link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
12
- <link type="text/css" href="skin/profile.css" rel="stylesheet">
13
- <script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
14
- <link rel="shortcut icon" href="">
15
- </head>
16
- <body onload="init()">
17
- <script type="text/javascript">ndeSetTextSize();</script>
18
- <div id="top">
19
- <!--+
20
- |header
21
- +-->
22
- <div class="header">
23
- <!--+
24
- |start group logo
25
- +-->
26
- <div class="grouplogo">
27
- <a href="http://www.jadeferret.com"><img class="logoImage" alt="Jade Ferret" src="images/jadeferret.png" title="Jade Ferret"></a>
28
- </div>
29
- <!--+
30
- |end group logo
31
- +-->
32
- <!--+
33
- |start Project Logo
34
- +-->
35
- <div class="projectlogo">
36
- <a href="http://ai4r.rubyforge.org/"><img class="logoImage" alt="ai4r" src="images/ai4r-logo.png" title="AI4R - Artificial Intelligence for Ruby"></a>
37
- </div>
38
- <!--+
39
- |end Project Logo
40
- +-->
41
- <!--+
42
- |start Search
43
- +-->
44
- <div class="searchbox">
45
- <div class="roundtopsmall">
46
- <form target="_top" action="http://www.google.com/custom" method="get">
47
- <input value="ai4r.rubyforge.org;raa.ruby-lang.org;rubyforge.org" name="domains" type="hidden"><label style="display: none" for="sbi">Enter your search terms</label><input id="sbi" value="" maxlength="255" size="31" name="q" type="text"><label style="display: none" for="sbb">Submit search form</label><input id="sbb" value="Search" name="sa" type="submit"><span style="display:none"><input id="ss0" value="" name="sitesearch" style="display=none" type="radio"><input id="ss1" checked value="ai4r.rubyforge.org" name="sitesearch" style="display=none" type="radio"><input id="ss2" value="raa.ruby-lang.org" name="sitesearch" style="display=none" type="radio"><input id="ss3" value="rubyforge.org" name="sitesearch" style="display=none" type="radio"></span><input value="pub-2578934938711895" name="client" type="hidden"><input value="1" name="forid" type="hidden"><input value="ISO-8859-1" name="ie" type="hidden"><input value="ISO-8859-1" name="oe" type="hidden"><input value="active" name="safe" type="hidden"><input value="0000" name="flav" type="hidden"><input value="XEZZoGuMPMQqvUG_" name="sig" type="hidden"><input value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;LH:50;LW:78;L:http://ai4r.rubyforge.org/images/ai4r-logo.png;S:http://ai4r.rubyforge.org/;FORID:1" name="cof" type="hidden"><input value="en" name="hl" type="hidden">
48
- </form>
49
- </div>
50
- </div>
51
- <!--+
52
- |end search
53
- +-->
54
- <!--+
55
- |start Tabs
56
- +-->
57
- <ul id="tabs">
58
- <li class="current">
59
- <a class="selected" href="index.html">Home</a>
60
- </li>
61
- </ul>
62
- <!--+
63
- |end Tabs
64
- +-->
65
- </div>
66
- </div>
67
- <div id="main">
68
- <div id="publishedStrip">
69
- <!--+
70
- |start Subtabs
71
- +-->
72
- <div id="level2tabs"></div>
73
- <!--+
74
- |end Endtabs
75
- +-->
76
- <script type="text/javascript"><!--
77
- document.write("Last Published: " + document.lastModified);
78
- // --></script>
79
- </div>
80
- <!--+
81
- |breadtrail
82
- +-->
83
- <div class="breadtrail">
84
-
85
- &nbsp;
86
- </div>
87
- <!--+
88
- |start Menu, mainarea
89
- +-->
90
- <!--+
91
- |start Menu
92
- +-->
93
- <div id="menu">
94
- <div onclick="SwitchMenu('menu_selected_1.1', 'skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Home</div>
95
- <div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
96
- <div class="menuitem">
97
- <a href="index.html" title="ai4r - Artificial Intelligence for Ruby">Index</a>
98
- </div>
99
- <div onclick="SwitchMenu('menu_selected_1.1.2', 'skin/')" id="menu_selected_1.1.2Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Practical Examples</div>
100
- <div id="menu_selected_1.1.2" class="selectedmenuitemgroup" style="display: block;">
101
- <div class="menuitem">
102
- <a href="geneticAlgorithms.html" title="Genetic Algorithms in ruby">Genetic Algorithms</a>
103
- </div>
104
- <div class="menuitem">
105
- <a href="machineLearning.html" title="ID3 Decision Trees in ruby">Machine Learning</a>
106
- </div>
107
- <div class="menupage">
108
- <div class="menupagetitle">Neural Networks</div>
109
- </div>
110
- </div>
111
- <div class="menuitem">
112
- <a href="downloads.html" title="ai4r - Download Files">Downloads</a>
113
- </div>
114
- <div class="menuitem">
115
- <a href="http://forum.jadeferret.com/viewforum.php?f=3" title="Ai4r Forum">Forum</a>
116
- </div>
117
- <div class="menuitem">
118
- <a href="sourceCode.html" title="ai4r source code repository">Source Code repository</a>
119
- </div>
120
- <div class="menuitem">
121
- <a href="http://wiki.jadeferret.com/Category:AI4R" title="ai4r wiki with How-to guides and more documentation">AI4R Wiki</a>
122
- </div>
123
- <div class="menuitem">
124
- <a href="http://ai4r.rubyforge.org/rdoc/index.html" title="Ai4 RDoc docs">API doc (Rdoc)</a>
125
- </div>
126
- </div>
127
- <div id="credit">
128
- <script type="text/javascript">
129
- google_ad_client = "pub-2578934938711895";
130
- google_ad_slot = "6111091580";
131
- google_ad_width = 125;
132
- google_ad_height = 125;
133
- </script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
134
- <hr>
135
- </div>
136
- <div id="roundbottom">
137
- <img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
138
- <!--+
139
- |alternative credits
140
- +-->
141
- <div id="credit2"></div>
142
- </div>
143
- <!--+
144
- |end Menu
145
- +-->
146
- <!--+
147
- |start content
148
- +-->
149
- <div id="content">
150
- <div title="Portable Document Format" class="pdflink">
151
- <a class="dida" href="neuralNetworks.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
152
- PDF</a>
153
- </div>
154
- <h1>OCR example using Backpropagation networks in ruby :: ai4r</h1>
155
- <div id="minitoc-area">
156
- <ul class="minitoc">
157
- <li>
158
- <a href="#nn-Introduction">Introduction to Neural Networks</a>
159
- </li>
160
- <li>
161
- <a href="#nn-example">Modeling the OCR problem using Neural Networks networks</a>
162
- </li>
163
- <li>
164
- <a href="#nn2-example">Implementing a basic OCR application using ruby and AI4R</a>
165
- </li>
166
- <li>
167
- <a href="#nn3-example">Results obtained with the AI4R OCR algorithm</a>
168
- </li>
169
- <li>
170
- <a href="#nn-custom">Customizing your neural network in ai4r</a>
171
- </li>
172
- <li>
173
- <a href="#nn-more">More about Neural Networks and Backpropagation</a>
174
- </li>
175
- </ul>
176
- </div>
177
-
178
- <a name="N1000D"></a><a name="nn-Introduction"></a>
179
- <h2 class="boxed">Introduction to Neural Networks</h2>
180
- <div class="section">
181
- <p>
182
- The utility of artificial neural network models lies in the fact
183
- that they can be used to infer a function from observations. This is
184
- particularly useful in applications where the complexity of the data
185
- or task makes the design of such a function by hand impractical.
186
- Neural Networks are being used in many businesses and applications.
187
- Their ability to learn by example makes them attractive in environments
188
- where the business rules are either not well defined or are hard to
189
- enumerate and define. Many people believe that Neural Networks can
190
- only solve toy problems. Give them a try, and let you decide if they
191
- are good enough to solve your needs.
192
- </p>
193
- <p>
194
- In this module you will find an implementation of neural networks
195
- using the Backpropagation is a supervised learning technique
196
- (described by Paul Werbos in 1974, and further developed by David E.
197
- Rumelhart, Geoffrey E. Hinton and Ronald J. Williams in 1986)
198
- </p>
199
- </div>
200
-
201
- <a name="N1001A"></a><a name="nn-example"></a>
202
- <h2 class="boxed">Modeling the OCR problem using Neural Networks networks</h2>
203
- <div class="section">
204
- <p>
205
- Let's imagine that we have to implement a program to identify simple patterns
206
- (triangles, squares, crosses, etc). The main problem is that this program must
207
- be resistant to random noise in the image (pixels with wrong values) and
208
- line noise (similar to the unwanted direct current that we usually have in a
209
- signal).
210
- </p>
211
- <p>
212
- In order to solve this problem, we can take an example of each pattern
213
- to be recognized, and train a neural network to identify similar patterns.
214
- In fact, one of the most popular uses of neural networks in business
215
- applications is OCR (opticar character recognition)
216
- </p>
217
- <p>
218
- In our porposed solotion, we create a network with the following
219
- architecture: 256 input neurons and 3 output neurons. We feed this network
220
- with 16x16 matrices (in fact will convert them to vectors of length 256).
221
- Each pixel is represented with a number from 0 (white pixel) to 10
222
- (black pixel). The output of this network if a 3 vector of dimension 3,
223
- where ideally:
224
- </p>
225
- <ul>
226
-
227
- <li>(1, 0, 0) for triangles</li>
228
-
229
- <li>(0, 1, 0) for squares</li>
230
-
231
- <li>(0, 0, 1) for crosses</li>
232
-
233
- </ul>
234
- <p>We train our backpropagation neural network using the following examples:</p>
235
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
236
-
237
- <caption>Training patterns</caption>
238
-
239
- <tr>
240
-
241
- <td colspan="1" rowspan="1"><img alt="Triangule training example" src="/images/t.png"></td>
242
- <td colspan="1" rowspan="1"><img alt="Square training example" src="/images/s.png"></td>
243
- <td colspan="1" rowspan="1"><img alt="Cross training example" src="/images/c.png"></td>
244
-
245
- </tr>
246
-
247
- </table>
248
- </div>
249
-
250
- <a name="N10057"></a><a name="nn2-example"></a>
251
- <h2 class="boxed">Implementing a basic OCR application using ruby and AI4R</h2>
252
- <div class="section">
253
- <p>The code bellow shows the basic steps to use Backpropagation Neural
254
- Networks in AI4R:</p>
255
- <pre class="code">
256
-
257
- # Create the network with:
258
- # 4 inputs
259
- # 1 hidden layer with 3 neurons
260
- # 2 outputs
261
- net = Ai4r::NeuralNetwork::Backpropagation.new([4, 3, 2])
262
-
263
- # Train the network
264
- 100.times do |i|
265
- net.train(example[i], result[i])
266
- end
267
-
268
- # Use it: Evaluate data with the trained network
269
- net.eval([12, 48, 12, 25]) # =&gt; [0.89, 0.04]
270
-
271
- </pre>
272
- <p>This is the source code used to elaborate this simple OCR application
273
- (You can find it inside the AI4R zip file release):</p>
274
- <pre class="code">
275
-
276
- require "rubygems"
277
- require "ai4r"
278
- require File.dirname(__FILE__) + '/training_patterns'
279
- require File.dirname(__FILE__) + '/patterns_with_noise'
280
- require File.dirname(__FILE__) + '/patterns_with_base_noise'
281
-
282
- # Create a network with 256 inputs, and 3 outputs
283
- net = Ai4r::NeuralNetwork::Backpropagation.new([256, 3])
284
-
285
- # Load training data
286
- tr_input = TRIANGLE.flatten.collect { |input| input.to_f / 10}
287
- sq_input = SQUARE.flatten.collect { |input| input.to_f / 10}
288
- cr_input = CROSS.flatten.collect { |input| input.to_f / 10}
289
- # Train the network
290
- puts "Training the network, please wait."
291
- 100.times do
292
- net.train(tr_input, [1,0,0])
293
- net.train(sq_input, [0,1,0])
294
- net.train(cr_input, [0,0,1])
295
- end
296
-
297
- # Load test data with noise
298
- tr_with_noise = TRIANGLE_WITH_NOISE.flatten.collect { |input| input.to_f / 10}
299
- sq_with_noise = SQUARE_WITH_NOISE.flatten.collect { |input| input.to_f / 10}
300
- cr_with_noise = CROSS_WITH_NOISE.flatten.collect { |input| input.to_f / 10}
301
-
302
- tr_with_base_noise = TRIANGLE_WITH_BASE_NOISE.flatten.collect { |input| input.to_f / 10}
303
- sq_with_base_noise = SQUARE_WITH_BASE_NOISE.flatten.collect { |input| input.to_f / 10}
304
- cr_with_base_noise = CROSS_WITH_BASE_NOISE.flatten.collect { |input| input.to_f / 10}
305
-
306
- # Print the evaluation results
307
-
308
- def result_label(result)
309
- if result[0] &gt; result[1] &amp;&amp; result[0] &gt; result[2]
310
- "TRIANGLE"
311
- elsif result[1] &gt; result[2]
312
- "SQUARE"
313
- else
314
- "CROSS"
315
- end
316
- end
317
-
318
- puts "Training Examples"
319
- puts "#{net.eval(tr_input).inspect} =&gt; #{result_label(net.eval(tr_input))}"
320
- puts "#{net.eval(sq_input).inspect} =&gt; #{result_label(net.eval(sq_input))}"
321
- puts "#{net.eval(cr_input).inspect} =&gt; #{result_label(net.eval(cr_input))}"
322
- puts "Examples with noise"
323
- puts "#{net.eval(tr_with_noise).inspect} =&gt; #{result_label(net.eval(tr_with_noise))}"
324
- puts "#{net.eval(sq_with_noise).inspect} =&gt; #{result_label(net.eval(sq_with_noise))}"
325
- puts "#{net.eval(cr_with_noise).inspect} =&gt; #{result_label(net.eval(cr_with_noise))}"
326
- puts "Examples with base noise"
327
- puts "#{net.eval(tr_with_base_noise).inspect} =&gt; #{result_label(net.eval(tr_with_base_noise))}"
328
- puts "#{net.eval(sq_with_base_noise).inspect} =&gt; #{result_label(net.eval(sq_with_base_noise))}"
329
- puts "#{net.eval(cr_with_base_noise).inspect} =&gt; #{result_label(net.eval(cr_with_base_noise))}"
330
-
331
- </pre>
332
- </div>
333
-
334
- <a name="N1006C"></a><a name="nn3-example"></a>
335
- <h2 class="boxed">Results obtained with the AI4R OCR algorithm</h2>
336
- <div class="section">
337
- <p>
338
- The results we got when we evaluate patterns with our trained network are:
339
- </p>
340
- <ul>
341
-
342
- <li>Evaluating the training patterns with the trained network:
343
- <ol>
344
-
345
- <li>
346
- <img alt="Triangule training example" src="/images/t.png">
347
- [0.98, 0.03, 0.01] =&gt; TRIANGLE </li>
348
-
349
- <li>
350
- <img alt="Square training example" src="/images/s.png">
351
- [0.00, 0.96, 0.03] =&gt; SQUARE </li>
352
-
353
- <li>
354
- <img alt="Cross training example" src="/images/c.png">
355
- [0.00, 0.00, 0.99] =&gt; CROSS </li>
356
-
357
- </ol>
358
-
359
- </li>
360
-
361
- <li>Evaluating the patterns with random noise with the trained network:
362
- <ol>
363
-
364
- <li>
365
- <img alt="Triangule pattern with random noise" src="/images/t_wn.png"> [0.98, 0.01, 0.01] =&gt; TRIANGLE </li>
366
-
367
- <li>
368
- <img alt="Square pattern with random noise" src="/images/s_wn.png"> [0.00, 0.96, 0.02] =&gt; SQUARE </li>
369
-
370
- <li>
371
- <img alt="Cross pattern with random noise" src="/images/c_wn.png"> [0.00, 0.00, 0.98] =&gt; CROSS </li>
372
-
373
- </ol>
374
-
375
- </li>
376
-
377
- <li>Evaluating the patterns with line noise with the trained network:
378
- <ol>
379
-
380
- <li>
381
- <img alt="Triangule pattern with line noise" src="/images/t_wbn.png"> [0.62, 0.00, 0.02] =&gt; TRIANGLE </li>
382
-
383
- <li>
384
- <img alt="Square pattern with line noise" src="/images/s_wbn.png"> [0.00, 0.75, 0.01] =&gt; SQUARE </li>
385
-
386
- <li>
387
- <img alt="Cross pattern with line noise" src="/images/c_wbn.png"> [0.00, 0.00, 0.98] =&gt; CROSS </li>
388
-
389
- </ol>
390
-
391
- </li>
392
-
393
- </ul>
394
- <p>These results are satisfactory. The network could sucessfully identify
395
- the patterns despite the noise introduced to them.</p>
396
- </div>
397
-
398
-
399
- <a name="N100CD"></a><a name="nn-custom"></a>
400
- <h2 class="boxed">Customizing your neural network in ai4r</h2>
401
- <div class="section">
402
- <p>Sometime for a given problem, you will have to "play around" with some parameters to
403
- get to a solution. This parameters are:</p>
404
- <p>
405
-
406
- <strong>Learning Rate</strong>: a real number, usually between 0.05
407
- and 0.25.
408
- </p>
409
- <p>
410
-
411
- <strong>Momentum</strong>: A momentum will avoid oscillations during
412
- learning, converging to a solution in less iterations.
413
- </p>
414
- <p>
415
- <strong>Propagation function</strong>: By default, f(x) = 1/(1 + e^(-x)).
416
- This function is called
417
- <a class="external" href="http://en.wikipedia.org/wiki/Sigmoid_function">
418
- Sigmoid function
419
- </a>. You can see it like a "smoothed" version of the
420
- <a class="external" href="http://en.wikipedia.org/wiki/Heaviside_step_function">
421
- Heaviside step function
422
- </a>. It will always provide a
423
- value between 0 and 1. </p>
424
- <p>
425
- <img alt="Sigmoid function" src="images/sigmoid.png"></p>
426
- <p>
427
- Sometimes you will have better results with f(x) = tanh(x), or even with
428
- f(x) = x. If you modify the propagation function, you have to supply the
429
- derivative function too (in terms of the propagation function result).
430
- </p>
431
- <p>To customize these parameters in AI4R, you can user the "set_parameters"
432
- method:</p>
433
- <pre class="code">
434
- net.set_parameters(
435
- :momentum =&gt; 0.15,
436
- :learning_rate =&gt; 0.5,
437
- :propagation_function =&gt; lambda { |x| Math.tanh(x) },
438
- :derivative_propagation_function =&gt; lambda { |y| 1.0 - y**2 }
439
- )
440
- </pre>
441
- <p>You can also use the attribute accesors:</p>
442
- <pre class="code">
443
- net.momentum = 0.15
444
- net.learning_rate = 0.5
445
- net.propagation_function = lambda { |x| Math.tanh(x) }
446
- net.derivative_propagation_function = lambda { |y| 1.0 - y**2 }
447
- </pre>
448
- </div>
449
-
450
- <div class="note">
451
- <div class="label">Note</div>
452
- <div class="content">Remember to set the custom parameters BEFORE training the network</div>
453
- </div>
454
-
455
- <a name="N1010B"></a><a name="nn-more"></a>
456
- <h2 class="boxed">More about Neural Networks and Backpropagation</h2>
457
- <div class="section">
458
- <ul>
459
-
460
- <li>
461
-
462
- <a class="external" href="http://en.wikipedia.org/wiki/Artificial_neural_network">Wikipedia article on Artificial Neural Networks</a>
463
-
464
- </li>
465
-
466
- <li>
467
-
468
- <a class="external" href="http://en.wikipedia.org/wiki/Backpropagation">Wikipedia article on Backpropagation Algorithm</a>
469
-
470
- </li>
471
-
472
- <li>
473
-
474
- <a class="external" href="http://www.tek271.com/articles/neuralNet/IntoToNeuralNets.html">Neural Networks - An Introduction by Abdul Habra</a>
475
-
476
- </li>
477
-
478
- <li>
479
-
480
- <a class="external" href="http://galaxy.agh.edu.pl/~vlsi/AI/backp_t_en/backprop.html">A graphical explanation of the
481
- backpropagation algorithm by Mariusz Bernacki and Przemysław Włodarczyk</a>
482
-
483
- </li>
484
-
485
- </ul>
486
- </div>
487
-
488
-
489
- </div>
490
- <!--+
491
- |end content
492
- +-->
493
- <div class="clearboth">&nbsp;</div>
494
- </div>
495
- <div id="footer">
496
- <!--+
497
- |start bottomstrip
498
- +-->
499
- <div class="lastmodified">
500
- <script type="text/javascript"><!--
501
- document.write("Last Published: " + document.lastModified);
502
- // --></script>
503
- </div>
504
- <div class="copyright">
505
- Copyright &copy;
506
- 2007-2009 <a href="http://www.jadeferret.com/">Sergio Fierens, Jade Ferret</a>
507
- </div>
508
- <div class="host">
509
- <a href="http://rubyforge.org/projects/ai4r/"><img class="logoImage" alt="" src="images/rubyforge.png"></a>
510
- </div>
511
- <!--+
512
- |end bottomstrip
513
- +-->
514
- </div>
515
- <script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script><script type="text/javascript">
516
- var pageTracker = _gat._getTracker("UA-3234625-1");
517
- pageTracker._initData();
518
- pageTracker._trackPageview();
519
- </script>
520
- </body>
521
- </html>