📄 art_doc.txt
字号:
To get the input size, use GetNetInSize.
To get the output size,use GetNetOutSize.
2.3.3 Training The Network
The network is trained using the procedure, TrainSet. TrainSet
must be passed a pointer to an initialized network of type "netTYPE",
a pointer to a set of training patterns of type "setTYPE", and a
maximum number of epochs for training.
Before calling TrainSet, network vigilance levels and recoding rates
can be set using SetArtVigil, SetArtBeta and SetMapVigil.
This procedure will continue to train the network until stable
learning has been achieved or the maximum number of training epochs
is reached.
After each training epoch, TrainSet updates information about the
number of resets and mismatches that occurred during that training
epoch. This information can be accessed using GetArtResets and
GetNetMismatch.
Additionally, TrainSet notes when the network has achieved stable
learning. This can be checked using GetNetDone, which returns TRUE
when the network has achieved stable learning and FALSE otherwise.
2.3.4 Testing the Network
The network's performance can be tested using TestNet which will
return information about the number of ArtA and ArtB no-answers,
the number of inputs correctly classified and the number incorrectly
classified. Note that for an ART network there is no such thing
as incorrectly classfying an input as the classification learning is
unsupervised. The network can only make a mistake by not answering
(ie, not meeting the vigilance level).
Alternatively, the network can be tested by using ShowPat, which
will present a single pattern to the network from a pattern set.
To access the resulting network activations, use the following:
GetArtWinner returns the winning category for an Art component.
GetMap returns the Mapfield activations.
2.3.5 Saving and Loading Networks
All networks are stored in files with the extention ".net". This
extension is automatically added to the filename, when files are
saved and loaded.
To load or save a network use LoadNet and SaveNet without the ".net"
extension.
2.3.6 Freeing Network Space
When a network is no longer going to be used it is a good idea to
clear the memory being used by the network before loading or
initializing a new network. This can be done using FreeNet.
Failure to do so may result in problems with running out of memory.
2.4 Pattern Sets
Patterns sets consits of a list of input (and in some cases output)
patterns to be presented to the network, as well as specifics about
the type of data contained in the pattern set. They are stored in a
data structure of type "setTYPE", and can be pointed to by a pointer
of type "setPTR" both of which are defined in Art_Lib.h.
2.4.1 Creating a Pattern Set
Pattern sets are created using MakeSet. MakeSet creates a new pattern
set given the desired number of input and output patterns for the
pattern set as well as the type of patterns and two files containing
the input and output data.
Input and output patterns can be of type ANALOG or BINARY.
Output patterns can also be of type NONE if the set is to contain
only input patterns.
The two data files containing input and output data should consist of
one number per line, with no blank lines between patterns. Two
sample files "analog.dat" and "binary.dat" have been provided to
demonstrate how this might be done.
Patterns can be added to the pattern set using AddPattern.
2.4.2 Data "Type"
Input and output data come in three types, NONE, BINARY and ANALOG.
BINARY patterns must be either 0 or 1, and can be used with either
ART1 or FUZZYART components.
ANALOG input patterns must be between 0 and 1, and can only be used by
FUZZYART components.
An ART-type network doesn't use output patterns, so outputs can be
of any type, including NONE.
2.4.3 Examining Pattern Set Parameters and Data
Data in the pattern set can (and should) be accessed without reference
to parts of the data structure itself. A number of functions have
been provided for easy access to pattern set information.
The size and type of the input patterns for a pattern set can be
checked using GetSetInSize, GetSetOutSize, GetSetInType, and
GetSetOutType.
Particular input and output pattern data can be retrieved using
GetSetInput and GetSetOutput.
To find out the number of patterns in the pattern set use
GetNumPatterns.
2.4.4 Saving and Loading Pattern Sets
All pattern sets are stored in files with the extention ".set".
This extension is automatically added to the filename, when files are
saved and loaded.
Pattern sets can be loaded and saved using SaveSet and LoadSet
without the ".set" extension.
2.4.5 Merging Pattern Sets
Two pattern sets can be merged using MargeSets.
2.4.6 Freeing Pattern Set Space
When a pattern set is no longer going to be used it is a good idea
to clear the memory being used by the pattern set before loading or
initializing a new pattern set. This can be done using FreeSet.
Failure to do so may result in problems with running out of memory.
2.5 Note on Error Checking and Variable Initialization
The procedures in the Art Gallery attempt to do extensive error
checking to ensure that all variables are properly initialized before
they are used.
GetNetInit and GetSetInit can also be used to check the initialization
status of a Pattern Set or Network.
Note, however, that there is always a small chance the the the area of
memory choosen for the initialization marker will coincidentally already
have the value of TRUE. This is especially true on the PC platform.
In this case initialization checks will fail GetNetInit and GetSetInit
will return incorrect values.
The only way to make 100% sure that procedures will return their
expected values is to only call them with initialized pattern sets and
networks.
2.6 Compliment Coding and Network Stability
It is generally a good idea to use compliment coding when creating
a new network to ensure that stable learning will occur. Without
compliment coding established categories can erode. This is
especially important when type NONE is selected for the ARTB network.
When compliment coding is used the size of network inputs must be
twice the size inputs in the pattern set. The compliment coded
values are automatically calculated by the program.
When a network uses compliment coding, a 'negative' copy of the
inputs is also presented to the network. So, for example, if an
input pattern consists of 5 values and compliment coding is used,
the network must have an input size of 10:
Pattern Set Input in pattern file:
0.2 0.3 0.5 0.7 0.1
Input presented to network when COMPLIMENT style is chose:
0.2 0.3 0.5 0.7 0.1 0.8 0.7 0.5 0.3 0.9
___________________________________________________________________________
3.0 COMPILING THE ART GALLERY AS A DYNAMIC LINKED LIBRARY (DLL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ART Gallery can be compiled as a dynamic linked using
Borland C++. This allows the ART Gallery functions to be called
from other Window's applications.
The DLL can then be by typing at the PC prompt:
'make -f art_gal'
The resulting DLL file will be callled:
'Art_Gal.dll'
3.1 Using the ART Gallery DLL's in Visual Basic
Once The ART Gallery has been compiled as a DLL, and declared in
Visual Basic, the ART Gallery functions can be called from Visual
Basic.
The file 'Default.bas' contains a Visual Basic module demonstrating
how the ART Gallery DLL's should be declared in Visual Basic.
See section 4.2 for an example of how The ART Gallery can be used
in Visual Basic.
___________________________________________________________________________
4.0 SAMPLE SIMULATORS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.1 Unix and Dos Sample Text Simulator
The file "Art_Sim.c" should have been included with the Art Gallery.
It contains a sample of how the Art Gallery might be used to create
a simple text driven neural network simulator.
A sample training and testing set have also been provided. (See
section 5.0).
On Unix:
Art_Sim.c can be compiled with the included Makefile by
typing 'make' at the Unix prompt.
On Dos: (Using Borland C++)
Art_Sim.c can then be compiled by typing at the PC prompt:
'make -f art_sim'
4.2 Sample Windows ART Gallery Simulator
The file "win_gal.zip" contains the install program for an graphical
windows version of The Art Gallery, 'Art_Gal.exe' created using The
Art Gallery functions complied as a Dynamic Linked Library.
___________________________________________________________________________
5.0 SAMPLE TRAINING AND TESTING FILES
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A sample training and testing pattern set file (train.pat and
test.pat) should have been included with the Art Library.
Each consists of 11 ANALOG input vectors and 6 BINARY output
vectors.
5.1 Sample Networks for training set
This data set can be used with many different types of networks.
A couple examples are shown below:
1) Unsupervised Learning (output vectors unused)
Network Type: ART
Art Type: FuzzyART *
Input Size: 11
Input Style: NONE
2) Supervised Learning with ArtB Module and Compliment Coding
Network Type: ARTMAP
ArtA Type: FuzzyART *
Input Size: 22 **
Input Style: COMPLIMENT
ArtB Type: ART1 ***
Input Size: 6
Input Style: NONE
3) Supervised Learning without training ArtB Module
Network Type: ARTMAP
ArtA Type: FuzzyART *
Input Size: 11
Input Style: NONE
ArtB Type: NONE
Input Size: 6 ****
* - Input must be of type FuzzyART since inputs are ANALOG
** - When compliment coding input size is double the size
of the input vector in the pattern set
*** - Input type for the ARTB network can be either FuzzyART
of ART1, since both can take BINARY pattenrs
**** - ARTB input size is the size of the input vector (not
zero) even when no ARTB training is used.
5.2 Sample Data for Making a Network
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -