| 1 |
/* manual_FFNet.cpp |
| 2 |
* |
| 3 |
* Copyright (C) 1994-2019,2023,2025,2026 David Weenink |
| 4 |
* |
| 5 |
* This code is free software; you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation; either version 3 of the License, or (at |
| 8 |
* your option) any later version. |
| 9 |
* |
| 10 |
* This code is distributed in the hope that it will be useful, but |
| 11 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
* General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
*/ |
| 18 |
|
| 19 |
/* |
| 20 |
djmw 20020408 GPL |
| 21 |
*/ |
| 22 |
|
| 23 |
#include "ManPagesM.h" |
| 24 |
|
| 25 |
#include "FFNet.h" |
| 26 |
|
| 27 |
static void drawFFNet_345 (Graphics g) |
| 28 |
{ |
| 29 |
autoFFNet me = FFNet_create (3, 4, 0, 5, false); |
| 30 |
FFNet_drawTopology (me.get(), g); |
| 31 |
} |
| 32 |
|
| 33 |
void manual_FFNet_init (ManPages me); |
| 34 |
void manual_FFNet_init (ManPages me) |
| 35 |
{ |
| 36 |
|
| 37 |
MAN_BEGIN (U"epoch", U"djmw", 20040428) |
| 38 |
INTRO (U"A term that is often used in the context of machine learning. An epoch is one complete " |
| 39 |
"presentation of the %%data set to be learned% to a learning machine.") |
| 40 |
NORMAL (U"Learning machines like @@FFNet|feedforward neural nets@ that use iterative algorithms " |
| 41 |
"often need many epochs during their learning phase.") |
| 42 |
NORMAL (U"A @@Discriminant|discriminant classifier@ is also a learning machine. " |
| 43 |
"However, in contrast with neural nets a discriminant classifier only needs one epoch to learn.") |
| 44 |
MAN_END |
| 45 |
|
| 46 |
MAN_BEGIN (U"Feedforward neural networks", U"djmw", 20040511) |
| 47 |
INTRO (U"This tutorial describes the use of @FFNet feedforward neural networks in Praat. ") |
| 48 |
NORMAL (U"@@Feedforward neural networks 1. What is a feedforward neural network?|1. What is a feedforward neural network?@") |
| 49 |
LIST_ITEM (U" @@Feedforward neural networks 1.1. The learning phase|1.1 The learning phase") |
| 50 |
LIST_ITEM (U" @@Feedforward neural networks 1.2. The classification phase|1.2 The classification phase") |
| 51 |
NORMAL (U"@@Feedforward neural networks 2. Quick start|2. Quick start@") |
| 52 |
NORMAL (U"@@Feedforward neural networks 3. FFNet versus discriminant classifier|3. FFNet versus discriminant classifier@") |
| 53 |
NORMAL (U"@@Feedforward neural networks 4. Command overview|4. Command overview@") |
| 54 |
MAN_END |
| 55 |
|
| 56 |
MAN_BEGIN (U"Feedforward neural networks 1. What is a feedforward neural network?", U"djmw", 20040426) |
| 57 |
INTRO (U"A feedforward neural network is a biologically inspired classification algorithm. " |
| 58 |
"It consist of a (possibly large) number of simple neuron-like processing %units, organized in %layers. " |
| 59 |
"Every unit in a layer is connected with all the units in the previous layer. " |
| 60 |
"These connections are not all equal: each connection may have a different strength or %weight. " |
| 61 |
"The weights on these connections encode the knowledge of a network. " |
| 62 |
"Often the units in a neural network are also called %nodes.") |
| 63 |
NORMAL (U"Data enters at the inputs and passes through the network, layer by layer, until it arrives at the outputs. " |
| 64 |
"During normal operation, that is when it acts as a classifier, there is no feedback between layers. " |
| 65 |
"This is why they are called %%feedforward% neural networks. ") |
| 66 |
NORMAL (U"In the following figure we see an example of a 2-layered network with, from top to bottom: " |
| 67 |
"an output layer with 5 units, a %hidden layer with 4 units, respectively. The network has 3 input units.") |
| 68 |
PICTURE (5, 5, drawFFNet_345) |
| 69 |
NORMAL (U"The 3 inputs are shown as circles and these do not belong to any layer of the network (although the inputs " |
| 70 |
"sometimes are considered as a virtual layer with layer number 0). Any layer that is not an output layer is a " |
| 71 |
"%hidden layer. This network therefore has 1 hidden layer and 1 output layer. The figure also shows all the " |
| 72 |
"connections between the units in different layers. A layer only connects to the previous layer. ") |
| 73 |
NORMAL (U"The operation of this network can be divided into two phases:") |
| 74 |
NORMAL (U"@@Feedforward neural networks 1.1. The learning phase|1. The learning phase") |
| 75 |
NORMAL (U"@@Feedforward neural networks 1.2. The classification phase|2. The classification phase") |
| 76 |
MAN_END |
| 77 |
|
| 78 |
MAN_BEGIN (U"Feedforward neural networks 1.1. The learning phase", U"djmw", 20040428) |
| 79 |
INTRO (U"During the learning phase the weights in the FFNet will be modified. " |
| 80 |
"All weights are modified in such a way that when a pattern is presented, " |
| 81 |
"the output unit with the correct category, hopefully, will have the largest output value.") |
| 82 |
ENTRY (U"How does learning take place?") |
| 83 |
NORMAL (U"The FFNet uses a %supervised learning algorithm: besides the input pattern, " |
| 84 |
"the neural net also needs to know to what category the pattern belongs. " |
| 85 |
"Learning proceeds as follows: a pattern is presented at the inputs. " |
| 86 |
"The pattern will be transformed in its passage through the layers of the network until it " |
| 87 |
"reaches the output layer. The units in the output layer all belong to a different category. " |
| 88 |
"The outputs of the network as they are now are compared with the outputs as they ideally would " |
| 89 |
"have been if this pattern were correctly classified: in the latter case " |
| 90 |
"the unit with the correct category would have had the largest output value and the " |
| 91 |
"output values of the other output units would have been very small. " |
| 92 |
"On the basis of this comparison all the connection weights are modified a little bit to guarantee that, the next time " |
| 93 |
"this same pattern is presented at the inputs, the value of the output unit that corresponds with the correct category " |
| 94 |
"is a little bit higher than it is now and that, at the same time, the output values of all the other incorrect outputs are a " |
| 95 |
"little bit lower than they are now. (The differences between the actual outputs and the idealized outputs " |
| 96 |
"are propagated back from the top layer to lower layers to be used at these layers to modify connection weights. " |
| 97 |
"This is why the term %%backpropagation network% is also often used to describe this type of neural network.)") |
| 98 |
NORMAL (U"If you perform the procedure above once for every pattern and category pair in your data " |
| 99 |
"set you have performed one @epoch of learning.") |
| 100 |
NORMAL (U"The hope is that eventually, probably after many epochs, " |
| 101 |
"the neural net will come to remember these pattern-category pairs. " |
| 102 |
"You even hope that the neural net, when the learning phase has terminated, will be able to %generalize " |
| 103 |
"and has learned to " |
| 104 |
"@@FFNet & PatternList: To Categories...|classify@ correctly any unknown pattern presented to it. ") |
| 105 |
NORMAL (U"Because real-life data often contains noise as well as partly contradictory information, " |
| 106 |
"these hopes can be fulfilled only partly. ") |
| 107 |
NORMAL (U"For @@FFNet & PatternList & Categories: Learn...|learning@ you " |
| 108 |
"need to select three different objects together: a FFNet (the %classifier), " |
| 109 |
"a PatternList (the %inputs) and a Categories (the %%correct outputs%).") |
| 110 |
ENTRY (U"How long will the learning phase take?") |
| 111 |
NORMAL (U"In general, this question is hard to answer. It depends on the size of the neural network, " |
| 112 |
"the number of patterns to be learned, the number of epochs, the tolerance of the minimizer " |
| 113 |
"and the speed of your computer, how much computing time the learning phase may take. ") |
| 114 |
NORMAL (U"If computing time becomes excessive in your interactive environment then consider using the " |
| 115 |
"powerful @@Scripting|scripting@ facilities in Praat to process your learning job as a batch job. ") |
| 116 |
MAN_END |
| 117 |
|
| 118 |
MAN_BEGIN (U"Feedforward neural networks 1.2. The classification phase", U"djmw", 20040428) |
| 119 |
INTRO (U"In the classification phase, the weights of the network are fixed. ") |
| 120 |
NORMAL (U"A pattern, presented at the inputs, will be transformed from layer to layer until it reaches the output layer. " |
| 121 |
"Now classification can occur by selecting the category associated with the output unit that has " |
| 122 |
"the largest output value. " |
| 123 |
"For classification we only need to select an FFNet and a PatternList together and " |
| 124 |
"choose @@FFNet & PatternList: To Categories...|To Categories...@. ") |
| 125 |
NORMAL (U"In contrast to the @@Feedforward neural networks 1.1. The learning phase|learning phase@ classification is very fast.") |
| 126 |
MAN_END |
| 127 |
|
| 128 |
MAN_BEGIN (U"Feedforward neural networks 2. Quick start", U"djmw", 20040426) |
| 129 |
INTRO (U"You may create the iris example set with the @@Create iris example...@ command " |
| 130 |
"that you will find under the ##Feedforward neural networks# option in the #New menu. " |
| 131 |
"Three new objects will appear in the @@List of Objects@: a @FFNet, a @Categories and " |
| 132 |
"a @PatternList.") |
| 133 |
NORMAL (U"The #PatternList contains the @@iris data set@ in a matrix of 150 rows by 4 columns. " |
| 134 |
"To guarantee that every cell in the PatternList is in the [0, 1] interval, all measurement " |
| 135 |
"values were divided by 10. In the #Categories the three iris species %setosa, " |
| 136 |
"%versicolor, and %virginica were categorized with the numbers #1, #2 and #3, respectively. " |
| 137 |
"Because there are 4 data columns in the PatternList and 3 different iris species in the Categories, " |
| 138 |
"the newly created #FFNet has 4 inputs and 3 outputs. " |
| 139 |
"If you enter a positive number in one of the fields in the form, the FFNet will have " |
| 140 |
"this number of units in a %%hidden layer%. The name of the newly created FFNet " |
| 141 |
"will reflect its topology. If you opt for the standard setting, which is 0 hidden units, the FFNet will be named 4-3.") |
| 142 |
ENTRY (U"Learning the iris data") |
| 143 |
NORMAL (U"The first thing you probably might want to do is to let the #FFNet learn the association in " |
| 144 |
"each pattern-category pair. To do this select all three objects together and choose " |
| 145 |
"@@FFNet & PatternList & Categories: Learn...|Learn...@. " |
| 146 |
"A form will appear, asking you to supply some settings for " |
| 147 |
"the learning algorithm. Learning starts after you have clicked the OK button. " |
| 148 |
"As the example network has only a small number of weights that need to be adjusted, " |
| 149 |
"and the learning data set is very small, this will only take a very short time.") |
| 150 |
ENTRY (U"Classification") |
| 151 |
NORMAL (U"Now, if you are curious how well the FFNet has learned the iris data, you may select the " |
| 152 |
"#FFNet and the #PatternList together and choose @@FFNet & PatternList: To Categories...|To Categories...@. " |
| 153 |
"A new #Categories appears in the ##List of Objects# with the name `4-3_iris` (if `4-3` was the name of the FFNet and `iris` the name of the PatternList). " |
| 154 |
"We have two different Categories in the list of objects, the topmost one has the original categories, the other " |
| 155 |
"the categories as were assigned by the FFNet classifier. The obvious thing to do now is to compare the " |
| 156 |
"original categories with the assigned categories by making a @@Confusion|confusion table@. " |
| 157 |
"Select the two #Categories and choose @@Categories: To Confusion|To Confusion@ and a newly " |
| 158 |
"created @Confusion appears. Pressing the @Info button will show you an info window with, " |
| 159 |
"among others, the fraction correct. ") |
| 160 |
NORMAL (U"You may also want to " |
| 161 |
"@@Feedforward neural networks 3. FFNet versus discriminant classifier|compare the FFNet classifier with a discriminant classifier@.") |
| 162 |
ENTRY (U"Create other neural net topologies") |
| 163 |
NORMAL (U"With a #PatternList and a #Categories selected together, you can for example create a new #FFNet of a different topology.") |
| 164 |
MAN_END |
| 165 |
|
| 166 |
MAN_BEGIN (U"Feedforward neural networks 3. FFNet versus discriminant classifier", U"djmw", 20040426) |
| 167 |
NORMAL (U"You may want to compare the FFNet classifier with a discriminant classifier. " |
| 168 |
"Unlike the FFNet, a @@Discriminant|discriminant@ classifier does not need any iterative procedure in the " |
| 169 |
"learning phase and can be used immediately after creation for classification. " |
| 170 |
"The following three simple steps will give you the confusion matrix based on discriminant analysis:") |
| 171 |
LIST_ITEM (U"1. Select the PatternList and the Categories together and choose ##To Discriminant#. " |
| 172 |
"A newly created Discriminant will appear.") |
| 173 |
LIST_ITEM (U"2. Select the Discriminant and the PatternList together and choose ##To Categories...#. A newly created @Categories will appear.") |
| 174 |
LIST_ITEM (U"3. Select the two appropriate Categories and choose @@categories: To Confusion|To Confusion@. " |
| 175 |
"A newly created @Confusion will appear. After pushing the @Info button, the info window will " |
| 176 |
"show you the fraction correct.") |
| 177 |
NORMAL (U"See also the @@Discriminant analysis@ tutorial for more information.") |
| 178 |
MAN_END |
| 179 |
|
| 180 |
MAN_BEGIN (U"Feedforward neural networks 4. Command overview", U"djmw", 20040426) |
| 181 |
INTRO (U"FFNet commands") |
| 182 |
ENTRY (U"Creation:") |
| 183 |
LIST_ITEM (U"\\bu @@PatternList & Categories: To FFNet...@") |
| 184 |
LIST_ITEM (U"\\bu @@Create FFNet...@") |
| 185 |
ENTRY (U"Learning:") |
| 186 |
LIST_ITEM (U"\\bu @@FFNet & PatternList & Categories: Learn...@") |
| 187 |
LIST_ITEM (U"\\bu @@FFNet & PatternList & Categories: Learn slow...@") |
| 188 |
ENTRY (U"Classification:") |
| 189 |
LIST_ITEM (U"\\bu @@FFNet & PatternList: To Categories...@") |
| 190 |
ENTRY (U"Drawing:") |
| 191 |
LIST_ITEM (U"\\bu @@FFNet: Draw topology@") |
| 192 |
LIST_ITEM (U"\\bu @@FFNet: Draw weights...@") |
| 193 |
LIST_ITEM (U"\\bu @@FFNet: Draw cost history...@") |
| 194 |
ENTRY (U"Queries") |
| 195 |
LIST_ITEM (U"\\bu @@FFNet & PatternList & Categories: Get total costs...@") |
| 196 |
LIST_ITEM (U"\\bu @@FFNet & PatternList & Categories: Get average costs...@") |
| 197 |
LIST_ITEM (U"\\bu @@FFNet & PatternList & ActivationList: Get total costs...@") |
| 198 |
LIST_ITEM (U"\\bu @@FFNet & PatternList & ActivationList: Get average costs...@") |
| 199 |
ENTRY (U"Analysis:") |
| 200 |
LIST_ITEM (U"\\bu ##FFNet & PatternList: To ActivationList...#") |
| 201 |
LIST_ITEM (U"\\bu @@FFNet & PatternList & Categories: Get total costs...@") |
| 202 |
LIST_ITEM (U"\\bu @@FFNet & PatternList & Categories: Get average costs...@") |
| 203 |
LIST_ITEM (U"\\bu @@FFNet & PatternList & ActivationList: Get total costs...@") |
| 204 |
LIST_ITEM (U"\\bu @@FFNet & PatternList & ActivationList: Get average costs...@") |
| 205 |
ENTRY (U"Analysis:") |
| 206 |
LIST_ITEM (U"\\bu ##FFNet & PatternList: To Activation...#") |
| 207 |
ENTRY (U"Modification:") |
| 208 |
LIST_ITEM (U"\\bu @@FFNet: Reset...@") |
| 209 |
LIST_ITEM (U"\\bu ##FFNet: Select biases...#") |
| 210 |
LIST_ITEM (U"\\bu ##FFNet: Select all weights#") |
| 211 |
MAN_END |
| 212 |
|
| 213 |
MAN_BEGIN (U"FFNet", U"djmw", 19961015) |
| 214 |
INTRO (U"One of the @@types of objects@ in Praat.") |
| 215 |
NORMAL (U"A #FFNet models a feedforward neural net. A feedforward " |
| 216 |
"neural net can %learn associations between its %input and its %output. " |
| 217 |
"The @@Feedforward neural networks@ tutorial gives you an introduction to feedforward neural nets.") |
| 218 |
MAN_END |
| 219 |
|
| 220 |
MAN_BEGIN (U"FFNet: Draw topology", U"djmw", 19970218) |
| 221 |
INTRO (U"You can choose this command after selecting 1 or more @FFNet's.") |
| 222 |
ENTRY (U"Behaviour") |
| 223 |
NORMAL (U"Draws all units and all connections of a feedforward neural net.") |
| 224 |
MAN_END |
| 225 |
|
| 226 |
MAN_BEGIN (U"FFNet: Draw weights...", U"djmw", 20040422) |
| 227 |
INTRO (U"Draws the weights in a layer of the selected @FFNet feedforward neural net.") |
| 228 |
ENTRY (U"Settings") |
| 229 |
TERM (U"##Layer number") |
| 230 |
DEFINITION (U"determines the layer.") |
| 231 |
TERM (U"##Garnish") |
| 232 |
DEFINITION (U"determines whether additional information is drawn.") |
| 233 |
ENTRY (U"Behaviour") |
| 234 |
NORMAL (U"The weights are arranged in a matrix. The columns of this matrix are indexed by the units in the layer, " |
| 235 |
"while the rows are indexed by the units in the previous layer. There is one extra row for the biases." |
| 236 |
"The values of the weights are shown as rectangles. The area of a rectangle is proportional " |
| 237 |
"to the value. Negative values are shown as filled black rectangles.") |
| 238 |
MAN_END |
| 239 |
|
| 240 |
MAN_BEGIN (U"FFNet: Draw cost history...", U"djmw", 19970218) |
| 241 |
INTRO (U"You can choose this command after selecting 1 or more @FFNet's.") |
| 242 |
ENTRY (U"Settings") |
| 243 |
TERM (U"##Iteration range") |
| 244 |
DEFINITION (U"determines the horizontal range of the plot.") |
| 245 |
TERM (U"##Cost range") |
| 246 |
DEFINITION (U"determines the vertical range of the plot.") |
| 247 |
TERM (U"##Garnish") |
| 248 |
DEFINITION (U"determines whether a box and axis labels are drawn.") |
| 249 |
ENTRY (U"Behaviour") |
| 250 |
NORMAL (U"Draws the history of the cost versus iteration number during previous learning.") |
| 251 |
MAN_END |
| 252 |
|
| 253 |
MAN_BEGIN (U"FFNet: Extract weights...", U"djmw", 20040422) |
| 254 |
INTRO (U"Extract all the weights, from all the units in the specified layer of the selected " |
| 255 |
"@FFNet, to a @TableOfReal.") |
| 256 |
ENTRY (U"Settings") |
| 257 |
TERM (U"##Layer number") |
| 258 |
DEFINITION (U"determines the layer.") |
| 259 |
ENTRY (U"Behaviour") |
| 260 |
NORMAL (U"The weights will be arranged in the TableOfReal as follows: ") |
| 261 |
NORMAL (U"The table columns will be indexed by the unit numbers in the selected layer, " |
| 262 |
"while the rows will be indexed by the unit numbers from the previous layer. " |
| 263 |
"There will be one extra row to accommodate the bias weights. " |
| 264 |
"The rows and columns are labelled with layer number and unit number as \"L%i-%j\", where %i is the layer number and " |
| 265 |
"%j the unit number from that layer. The layer number for the rows is one less than the layer number in the columns. " |
| 266 |
"The last row is labelled as \"Bias\".") |
| 267 |
MAN_END |
| 268 |
|
| 269 |
MAN_BEGIN (U"FFNet: Get number of outputs", U"djmw", 20040420) |
| 270 |
INTRO (U"Queries the selected @FFNet for the number of output units in the output layer. ") |
| 271 |
MAN_END |
| 272 |
|
| 273 |
MAN_BEGIN (U"FFNet: Get number of inputs", U"djmw", 20040420) |
| 274 |
INTRO (U"Queries the selected @FFNet for the number of inputs. ") |
| 275 |
NORMAL (U"For a network with only one layer, the inputs are connected directly to the output layer. " |
| 276 |
"In a two-layer network the inputs are connected to a hidden layer.") |
| 277 |
MAN_END |
| 278 |
|
| 279 |
MAN_BEGIN (U"FFNet: Get number of hidden units...", U"djmw", 20040420) |
| 280 |
INTRO (U"Queries the selected @FFNet for the number of units in a hidden layer.") |
| 281 |
ENTRY (U"Settings") |
| 282 |
TERM (U"##Hidden layer number") |
| 283 |
DEFINITION (U"determines the layer that is queried.") |
| 284 |
ENTRY (U"Layer numbering") |
| 285 |
NORMAL (U"The number of hidden layers is always one less than the total number of layers in a FFNet. " |
| 286 |
"A network with the output units connected to the inputs therefore has only 1 layer, the output layer and " |
| 287 |
"no hidden layers. ") |
| 288 |
MAN_END |
| 289 |
|
| 290 |
MAN_BEGIN (U"FFNet: Get number of hidden weights...", U"djmw", 20040420) |
| 291 |
INTRO (U"Queries the selected @FFNet for the number of weights in a hidden layer.") |
| 292 |
ENTRY (U"Settings") |
| 293 |
TERM (U"##Hidden layer number") |
| 294 |
DEFINITION (U"determines the layer that is queried.") |
| 295 |
MAN_END |
| 296 |
|
| 297 |
MAN_BEGIN (U"FFNet: Reset...", U"djmw", 20040420) |
| 298 |
INTRO (U"You can choose this command after selecting 1 or more @FFNet's.") |
| 299 |
ENTRY (U"WARNING") |
| 300 |
NORMAL (U"This command destroys all previous learning.") |
| 301 |
ENTRY (U"Settings") |
| 302 |
TERM (U"##Range") |
| 303 |
DEFINITION (U"determines the upper limit of the [-%range, +%range] interval from " |
| 304 |
"which new weights will be randomly selected.") |
| 305 |
ENTRY (U"Behaviour") |
| 306 |
NORMAL (U"All (selected) weights are reset to random numbers uniformly drawn from the interval [-%range, +%range]. " |
| 307 |
"This command also clears the cost history.") |
| 308 |
MAN_END |
| 309 |
|
| 310 |
MAN_BEGIN (U"FFNet: Select biases...", U"djmw", 20040422) |
| 311 |
INTRO (U"Selects only the biases in one particular layer as subject for modification during learning of the @FFNet.") |
| 312 |
ENTRY (U"Settings") |
| 313 |
TERM (U"##Layer number") |
| 314 |
DEFINITION (U"determines the layer whose biases will be modified.") |
| 315 |
ENTRY (U"Behaviour") |
| 316 |
NORMAL (U"This command induces very specific behaviour during a following learning phase. " |
| 317 |
"Instead of all the weights, only the biases in the specified layer will be changed during learning and the " |
| 318 |
"rest of the weights stay fixed. ") |
| 319 |
MAN_END |
| 320 |
|
| 321 |
#define FFNet_Create_COMMON_HELP_INOUT \ |
| 322 |
ENTRY (U"Settings")\ |
| 323 |
TERM (U"##Number of inputs")\ |
| 324 |
DEFINITION (U"the dimension of the input of the neural net.")\ |
| 325 |
TERM (U"##Number of outputs (\\>_ 1)#")\ |
| 326 |
DEFINITION (U"the number of different categories that you want the net to learn.") |
| 327 |
|
| 328 |
#define FFNet_Create_COMMON_HELP_HIDDEN \ |
| 329 |
TERM (U"##Number of units in hidden layer 1#, ##Number of units in hidden layer 2#") \ |
| 330 |
DEFINITION (U"determine the number of units in the hidden layers. " \ |
| 331 |
"If you want a neural net with no hidden layers, both numbers have to be 0. "\ |
| 332 |
"If you want a neural net with only 1 hidden layer then one of these numbers should differ from 0. ") |
| 333 |
|
| 334 |
MAN_BEGIN (U"Create FFNet...", U"djmw", 20040420) |
| 335 |
INTRO (U"Create a new feedforward neural net of type @FFNet.") |
| 336 |
FFNet_Create_COMMON_HELP_INOUT |
| 337 |
FFNet_Create_COMMON_HELP_HIDDEN |
| 338 |
MAN_END |
| 339 |
|
| 340 |
MAN_BEGIN (U"Create FFNet (linear outputs)...", U"djmw", 20040422) |
| 341 |
INTRO (U"Create a @FFNet feedforward neural network whose output units are linear.") |
| 342 |
FFNet_Create_COMMON_HELP_INOUT |
| 343 |
FFNet_Create_COMMON_HELP_HIDDEN |
| 344 |
MAN_END |
| 345 |
|
| 346 |
MAN_BEGIN (U"Create iris example...", U"djmw", 20160524) |
| 347 |
INTRO (U"A @FFNet feedforward neural net will be created together with two other objects: " |
| 348 |
"a @PatternList and a @Categories. The PatternList will contain the observations in the @@iris data set@, " |
| 349 |
"and the Categories will contain the 3 different iris species categorized by numbers.") |
| 350 |
ENTRY (U"Settings") |
| 351 |
FFNet_Create_COMMON_HELP_HIDDEN |
| 352 |
NORMAL (U"For this simple data you can leave both hidden layers empty.") |
| 353 |
|
| 354 |
MAN_END |
| 355 |
|
| 356 |
MAN_BEGIN (U"iris data set", U"djmw", 19961015) |
| 357 |
NORMAL (U"A data set with 150 random samples of flowers from the iris species %setosa, " |
| 358 |
"%versicolor, and %virginica collected by @@Anderson (1935)@. From each species there are 50 observations for " |
| 359 |
"sepal length, sepal width, petal length, and petal width in cm. This dataset was " |
| 360 |
"used by @@Fisher (1936)@ in his initiation of the linear-discriminant-function technique.") |
| 361 |
MAN_END |
| 362 |
|
| 363 |
MAN_BEGIN (U"FFNet: Categories", U"djmw", 19960918) |
| 364 |
INTRO (U"The categories for training a neural net with a @PatternList. ") |
| 365 |
ENTRY (U"Preconditions") |
| 366 |
NORMAL (U"The number of categories in a @Categories must equal the number of rows in #PatternList.") |
| 367 |
MAN_END |
| 368 |
|
| 369 |
MAN_BEGIN (U"ActivationList", U"djmw", 20160524) |
| 370 |
INTRO (U"A list of activations, organized as a @Matrix whose elements should be >= 0 and <= 1. " |
| 371 |
"Classification: the response of a particular layer in a neural net to a @PatternList." |
| 372 |
"Learning: the desired response of the output layer in a neural net to a @PatternList.") |
| 373 |
MAN_END |
| 374 |
|
| 375 |
MAN_BEGIN (U"FFNet: Principal components", U"djmw", 19960918) |
| 376 |
INTRO (U"When you select @FFNet and @Eigen the decision planes of layer 1 are drawn in the PC-plane.\n") |
| 377 |
MAN_END |
| 378 |
|
| 379 |
MAN_BEGIN (U"FFNet & PatternList: To Categories...", U"djmw", 19960918) |
| 380 |
INTRO (U"The @FFNet is used as a classifier. Each pattern from the @PatternList will be " |
| 381 |
"classified into one of the FFNet's categories.") |
| 382 |
MAN_END |
| 383 |
|
| 384 |
MAN_BEGIN (U"PatternList & Categories: To FFNet...", U"djmw", 20040422) |
| 385 |
INTRO (U"Create a new @FFNet feedforward neural network. " |
| 386 |
"The number of inputs of the newly created FFNet will be equal to the number of " |
| 387 |
"columns in the @PatternList and the number of outputs " |
| 388 |
"will be equal to the number of unique categories in the @Categories.") |
| 389 |
ENTRY (U"Settings") |
| 390 |
FFNet_Create_COMMON_HELP_HIDDEN |
| 391 |
MAN_END |
| 392 |
|
| 393 |
MAN_BEGIN (U"FFNet & PatternList & Categories: Learn slow...", U"djmw", 19960918) |
| 394 |
INTRO (U"To learn an association you have to select a @FFNet, a @PatternList and a @Categories object.") |
| 395 |
ENTRY (U"Preconditions") |
| 396 |
LIST_ITEM (U"The number of columns in a #PatternList must equal the number of input units of #FFNet.") |
| 397 |
ENTRY (U" Algorithm") |
| 398 |
NORMAL (U"Steepest descent") |
| 399 |
ENTRY (U"Preconditions") |
| 400 |
LIST_ITEM (U"The number of rows in a #PatternList must equal the number of categories in a #Categories.") |
| 401 |
LIST_ITEM (U"The number of unique categories in a #Categories must equal the number of output units in #FFNet.") |
| 402 |
MAN_END |
| 403 |
|
| 404 |
MAN_BEGIN (U"FFNet & PatternList & Categories: Learn...", U"djmw", 20040511) |
| 405 |
INTRO (U"You can choose this command after selecting one @PatternList, one @Categories and one @FFNet.") |
| 406 |
ENTRY (U"Settings") |
| 407 |
TERM (U"##Maximum number of epochs") |
| 408 |
DEFINITION (U"the maximum number of times that the complete #PatternList dataset will be presented to the neural net.") |
| 409 |
TERM (U"##Tolerance of minimizer") |
| 410 |
DEFINITION (U"when the difference in costs between two successive learning cycles is " |
| 411 |
"smaller than this value, the minimization process will be stopped.") |
| 412 |
NORMAL (U"##Cost function") |
| 413 |
LIST_ITEM (U"Minimum-squared-error:") |
| 414 |
LIST_ITEM (U" %costs = \\su__%allPatterns_ \\su__%allOutputs_ (%o__%k_ - d__%k_)^2, where") |
| 415 |
LIST_ITEM (U" %o__%k_ : actual output of unit %k") |
| 416 |
LIST_ITEM (U" %d__%k_ : desired output of unit %k") |
| 417 |
LIST_ITEM (U"Minimum-cross-entropy:") |
| 418 |
LIST_ITEM (U" %costs = - \\su__%allPatterns_ \\su__%allOutputs_ (%d__%k_ \\.c ln %o__%k_ + (1-%d__%k_) \\.c ln (1-%o__%k_))") |
| 419 |
ENTRY (U"Algorithm") |
| 420 |
NORMAL (U"The minimization procedure is a variant of conjugate gradient minimization, " |
| 421 |
"see for example @@Press et al. (1992)@, chapter 10, or @@Nocedal & Wright (1999)@, chapter 5.") |
| 422 |
MAN_END |
| 423 |
|
| 424 |
MAN_BEGIN (U"FFNet & PatternList & Categories: Get total costs...", U"djmw", 20041118) |
| 425 |
INTRO (U"Query the selected @FFNet, @PatternList and @Categories for the total costs.") |
| 426 |
ENTRY (U"Algorithm") |
| 427 |
NORMAL (U"All patterns are propagated and the total costs are calculated as is shown in @@FFNet & PatternList & Categories: Learn...@. ") |
| 428 |
MAN_END |
| 429 |
|
| 430 |
MAN_BEGIN (U"FFNet & PatternList & ActivationList: Get total costs...", U"djmw", 20160524) |
| 431 |
INTRO (U"Query the selected @FFNet, @PatternList and @ActivationList for the total costs.") |
| 432 |
ENTRY (U"Algorithm") |
| 433 |
NORMAL (U"All patterns are propagated and the total costs are calculated as is shown in @@FFNet & PatternList & Categories: Learn...@. ") |
| 434 |
MAN_END |
| 435 |
|
| 436 |
MAN_BEGIN (U"FFNet & PatternList & Categories: Get average costs...", U"djmw", 20041118) |
| 437 |
INTRO (U"Query the selected @FFNet, @PatternList and @Categories for the average costs.") |
| 438 |
ENTRY (U"Algorithm") |
| 439 |
NORMAL (U"All patterns are propagated and the total costs are calculated as is shown in @@FFNet & PatternList & Categories: Learn...@. " |
| 440 |
"These total costs are then divided by the number of patterns.") |
| 441 |
MAN_END |
| 442 |
|
| 443 |
MAN_BEGIN (U"FFNet & PatternList & ActivationList: Get average costs...", U"djmw", 20160526) |
| 444 |
INTRO (U"Query the selected @FFNet, @PatternList and @ActivationList for the average costs.") |
| 445 |
ENTRY (U"Algorithm") |
| 446 |
NORMAL (U"All patterns are propagated and the total costs are calculated as is shown in @@FFNet & PatternList & Categories: Learn...@. " |
| 447 |
"These total costs are then divided by the number of patterns.") |
| 448 |
MAN_END |
| 449 |
|
| 450 |
MAN_BEGIN (U"Anderson (1935)", U"djmw", 20040423) |
| 451 |
NORMAL (U"E. Anderson (1935): \"The irises of the Gasp\\e' peninsula.\" " |
| 452 |
"%%Bulletin of the American Iris Society% #59: 2\\--5.") |
| 453 |
MAN_END |
| 454 |
|
| 455 |
MAN_BEGIN (U"Fisher (1936)", U"djmw", 19980114) |
| 456 |
NORMAL (U"R.A. Fisher (1936): \"The use of multiple measurements in taxonomic " |
| 457 |
"problems.\" %%Annals of Eugenics% #7: 179\\--188.") |
| 458 |
MAN_END |
| 459 |
|
| 460 |
MAN_BEGIN (U"Nocedal & Wright (1999)", U"djmw", 20040511) |
| 461 |
NORMAL (U"J. Nocedal & S.J. Wright (1999): %%Numerical optimization.% Springer.") |
| 462 |
MAN_END |
| 463 |
} |
| 464 |
|
| 465 |
/* End of file manual_FFNet.cpp */ |