Sunteți pe pagina 1din 14

SPICE-SOM USERS GUIDE

Cao Thang 2003 2007

Neuron j


OUTPUT LAYER

W ij

Neuron 1

W i1
INPUT LAYER

x1

xi

xn

1. INTRODUCTION This is a users guide for the Spice-SOM - a Self-Organizing Map (SOM) application. It does not intend to introduce about SOM theories. You can find more knowledge about SOM and Neural Network (NN) in other textbooks. Depending on the version, some contents of this material may be different with your downloaded Spice-SOM. The purpose of this program is to get you started quickly with Neural Network without having to go through lengthy theory of the Neural Network background. Once you understand these programs you will be able to consult the Neural Network materials on a need basis. Spice-SOM's arm is to introduce NN and SOM to graduated students studying Computational Intelligence. Currently Spice-SOM has been using by many students around the world. SpiceSOM has interfaces in Vietnamese, English and Japanese. Spice-SOM was written by CAO THANG (http://www.spice.ci.ritsumei.ac.jp/~thangc/) when he did researches in the Soft Intelligence Laboratory, Ritsumeikan University, Japan, 20032007. Spice-SOM and Spice-Neuro can be downloaded at http://www.spice.ci.ritsumei.ac.jp/~thangc/programs/ If you have questions or requirements about Spice-SOM, please contact the author at "thangc@spice.ci.ritsumei.ac.jp". Thank you.
Spice-SOM Users Guide 2012-02-07
Page 1

2. INSTALL THE SPICE-SOM Download setup file of the Spice-SOM and run setup.exe, setup welcome window will appears on the screen.

Fig. 1. Setup

Select 'Next', and then select a folder into that you want to install Spice-SOM, select 'Next' and 'Next', Spice-SOM will be installed into the selected folder.

Fig. 2. Select Folder

Spice-SOM Users Guide 2012-02-07

Page 2

Note: If the Spice-SOM does not run after installing, you may need to install Microsoft .NET Framework Redistributable Package 3.5.21022 before installing Spice-SOM.

3. USING SPICE-SOM Run Spice-SOM by clicking on Spice-SOM icon on your desktop or selecting Start Programs Cao Thangs Spice-SOM Spice-SOM.

First the program runs with the English interface, you can select Vietnamese or Japanese by selecting Options Languages.

Fig. 3. Select language

Menu About, README first is a briefly introduction about Spice-SOM and Users agreements. You should read it carefully before using Spice-SOM.

Spice-SOM Users Guide 2012-02-07

Page 3

Fig. 4. About Spice-SOM

Spice-SOM Users Guide 2012-02-07

Page 4

3.1. Data Preparation

Using your data by Spice-SOM, you should prepare your data by the following format: data is prepared in text format by rows and columns. The first column is ID, then Inputs and finally Labels. Values are separated by comma (Comma Separated Value File Format) with CSV file type, or Tab (Tab Separated Value File Format) with TXT file type. You may use MS Excel to edit your data, and then save it in text or csv format. For example data with 5 inputs, 4 datasets is organized as shown in Table 1.
Table 1. Text Data with 5 inputs, 4 dataset

ID 0 1 2 3

X1 0 0 1 1

X2 0 1 0 1

X3 0 1 1 0

X4 0 0 0 1

X5 0 1 1 1

LABEL Data 1 Data 2 Data 3 Data 4

ID: ID of Datasets

X: Input Data

LABEL: Labels of Datasets

Note: Data should be numeral, except labels. Spice-SOM cannot read your data if there is a blank data or null data. There are some good examples in \Data folder of the Spice-SOM: number5group1dimension is an example with 100 datasets, 1 input. number5group2dimension is an example with 100 datasets, 2 inputs. number5group3dimension is an example with 100 datasets, 3 inputs.

Spice-SOM Users Guide 2012-02-07

Page 5

3.2. Load Data

Suppose that we are using the data in number5group3dimension.txt file, 100 datasets and 3 inputs.

Input Data (Table)

Normalization Functions Input Data (Graph) Bar for Selecting Data

Fig. 5. Load Data

In Number of Input and Data Sets, you should select as illustrated in Fig.5. Then, select command button Browse from TEXT files, the data will be loaded into memory. In DATA group on the right, you can review each of loaded datasets. If your data is not normalized, you may use some normalization functions of Spice-SOM. In Tab Data Visualization, you can see graph of all loaded data if the number of data is not large, as illustrated in Fig.6.

Spice-SOM Users Guide 2012-02-07

Page 6

Fig. 6. View Input data

3.3. Network Training

Fig. 7. Select learning parameters

Spice-SOM Users Guide 2012-02-07

Page 7

2.3.1. Select Network and Training Parameters The training interface of Spice-SOM is shown in Fig.7. Before train your SOM network, you should choose its parameters as follows: Sigma Max: Maximum value of neighborhood function of a winner neuron. Sigma Min: Minimum value of neighborhood function of a winner neuron. Sigma Decreasing Rate: Decreasing rate of value of neighborhood function after one iteration Learning Rate Max: Maximum value of learning rate Learning Rate Min: Minimum value of learning rate Iterations: Number of iterations or epochs Inhibition: Inhibition value of Mexican Hat neighborhood function X Neurons: Number of Neurons in x directions Y Neurons: Number of Neurons in y directions If you select Continue current weights, the network will learn without resetting its initial weights. If you select View Graph Online, Graphs of Neighborhood Function and Mean of Square Error (MSE) will be shown on learning process, however the network will learn more slowly because your computer have to draw the graphs together with to train the network. Neighborhood Functions: You should select a type of neighborhood functions. Spice-SOM gives you some standard neighborhood functions as Rectangular, Gaussian, Mexican and Linear hat functions. Select Topology: Default topology of Spice-SOM is Rectangular. You can select Hexagonal topology by Checkbox Hexagonal Topology. Distances of neurons in these two topologies are different as illustrated in Fig.8.
HEXAGONAL: O O O O O O O O O O O O & & & O O O O O & @ @ & O O O O O & @ + @ & O O O O & @ @ & O O O O O O & & & O O O O O O O O O O O O O O O O O O O RECTANGULAR: O O O O O O O O O O & O O O O O & @ & O O O & @ + @ & O O O & @ & O O O O O & O O O O O O O O O O O O O O O O O

Fig. 8. Rectangular Topology and Hexagonal Topology

Spice-SOM Users Guide 2012-02-07

Page 8

2.3.2. Training After selecting suitable parameters, you can train the network. Here are main command buttons: Training: Start the training process. Save Weights to Binary File: Save current network weights to binary file. Save Weights to Text File: Save current network weights to text file, you can easily check each neuron's weights in this text file. Load Weights from Binary File: Load weights from a saved binary file. Save MSE Graph to Text File: Save MSE graph data to text file. Set Default Value: Set parameters as their default values.

Table 2 illustrates MSE graph data that is saved in a text file. Table 3 illustrates network weights that are saved on a text file.

Table 2. MSE graph data

Iteration 0 1 2 3 4 5 95 96 97 98 99

Error 10.02597948 4.14776422 3.42406203 3.378296441 3.256567794 3.209400383 1.018524437 1.011947207 1.007276918 1.002205101 0.998116728

Neighbor Distance 10 9.9 9.8 9.7 9.6 9.5 2 2 2 2 2

Learning Rate 0.0991 0.0982 0.0973 0.0964 0.0955 0.0946 0.0136 0.0127 0.0118 0.0109 0.0100

Spice-SOM Users Guide 2012-02-07

Page 9

Table 3. Network weights in text file

Neurons Neuron Y = 0, X = 0: Neuron Y = 0, X = 1: Neuron Y = 0, X = 2: Neuron Y = 0, X = 3:

Input0 36.99527651 36.85168189 36.36203974 35.27379557

Input1 40.76692789 40.01821143 39.09389637 38.58864861

Input2 37.21308 36.97461 36.61739 36.22565

Neuron Y = 19, X = 16: Neuron Y = 19, X = 17: Neuron Y = 19, X = 18: Neuron Y = 19, X = 19:

19.76819369 17.5739719 12.60898022 8.678481001

5.711848278 6.150696979 6.978729306 7.590027624

3.108250741 3.292584748 3.15416311 2.853186784

4. Data Distribution Map

After the network learning, you can see the data distribution map in Tab Output Distribution Image as illustrated in Fig.9. On the map, neurons are arranged in rows and columns. Click mouse on a neuron position, in the detailed neuron window you will see labels of data that are fallen on this neuron. You can also see distances from selected neuron (by clicking left mouse button) to its neighbor neurons. You can display blank neuron color, winner neuron color, or distance color between neurons. The distance color between two neurons is distance between them displayed by grayscale with value 0 (farthest) and 255 (closest). Color of a neuron is an average of distance colors from this neuron to its adjacent neurons. Gray color between two neurons presents the distance color between them. The options for displaying distribution map are the following. View detailed on left bottom: Put the detailed window on the left bottom View detailed on right top: Put the detailed window on the top right Keep Previous Connections: Keep current connections while viewing new connections from new selected neurons Distance Color: Select gray level for distance color. Distance Line: Select value level for displaying connections on the map. Map Scale: Select scale of the map on the screen.

Spice-SOM Users Guide 2012-02-07

Page 10

Show Output Map Options: Display options for distribution map: o Image Width, Image Height: Size of the map that you want to save (in case you want to resize the map). o Image Format: Format of the saved map (JPG, PNG, BMP) o Print Neuron Number: Print orders of neurons on the map o Fill Blank Neuron: Print distance color of blank neurons. o Fill Winner Neuron: Print distance color of winner neurons. o Show Distance Color: Print distance colors between neurons. o Save Original Size: Save the map with original size. o Show Hexagonal Topology: Select hexagonal topology for the map (default is rectangular topology).

Select the command button Save Output Image, the output map will be saved on hard disk. Figs.10 and 11 show an example of output map. You can view the output table by selecting the Tab Output Distribution Table, as illustrated in Fig.12. You also can save this table by command button Save Output Table. After re-training the network, you need to choose command button Refresh Output Table.

Spice-SOM Users Guide 2012-02-07

Page 11

Detailed of selected neuron

Distance from a neuron to its neighbor neurons

Options for output map

Gray color on a neuron demonstrates its distances to adjency neurons Gray color between two neurons demonstrates their own distances

Selecting bars for distance color and distance line values

Save current output map

Fig. 9. Output map after learning

Fig 10. Output map (hexagonal topology)

Spice-SOM Users Guide 2012-02-07

Page 12

Fig 11. Output map (Rectangular topology)

Fig 12. Output Table

Spice-SOM Users Guide 2012-02-07

Page 13

5. Conclusions This material guides you to use Spice-SOM, a Self-Organizing Map application. Having used this application, you may have a better understanding on Self-Organizing Map. Like SpiceNeuro (a Multi-Layer Neural Network Application), you can use Spice-SOM to model various data in different practical domains such as pattern recognition, clustering, decision making... The author hopes that Spice-SOM would be useful for your study and research. Thank you for using Spice-SOM. If you need more functions in Spice-SOM, please do not hesitate to contact author at thangc@spice.ci.ritsumei.ac.jp. Your ideas and requirements are always welcomed. Thank you!

Spice-SOM Users Guide 2012-02-07

Page 14

S-ar putea să vă placă și