Patterns

Patterns are stored in text files. A simple example is shown here for learning logical ‘and’:

Number of patterns = 4
Number of inputs = 2
Number of outputs = 1
[Patterns]
0 0      0
1 0      0
0 1      0
1 1      1

Pattern files are easy to produce either by hand, or with the aid of simple Perl scripts or the like. Some samples will be provided in a later page.  Individual pattern elements can be separated by spaces or tabs.  The gap illustrated between inputs and targets is for ease of reading only.

For Recurrent Neural Networks, it is possible to break up the sequence of patterns into individual sequences, and to force a network reset after each sequence.  This is illustrated below:

 

Number of patterns = 378
Number of inputs = 1
Number of outputs = 1
[Patterns]
0   0
1   1
1   0
1   1
0   1
0   1
reset
0   0
1   1
1   0
1   1
reset
0   0
1   1
1   0
1   1
1   0
1   1
reset 
. . . etc

Note that when training a recurrent network, patterns are always presented in the sequential order in which they occur in the pattern file. For feed forward networks, this is true only if the ‘Batch Update’ checkbox is ticked.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s