Brain Database

Spud Ai

Brain Database (BD)

The BD holds all the information required by the various process within the program. Each entry in it is called a Cell. Each cell in the BD has a 9 bit neural network which is activated by various processes
Some of the fields in the cell have a specific use and others are used for different things.
The BD is a combination of two databases merged together. Ai versions previous to version AiV016a had two databases called TF Translation file, and NNE Neural Network Extended. This is why there are some references to the TF or NNE in keywords and the help file in general. These references will change over time as and when the help file is updated.

cell 1 holds the length of the BD
cells 2 to 802 have no set use
cells 802 to 2000 are System Cells and are used by the program for various functions details here BrainSystemCells.htm
cells 2000 upward is data added to the database by various functions

A field either holds a number or text

number or text name Description.
number
1 or 0
previous input Input code used in the previous activation, mostly used by the cell event scanner to see if there has been a change to the input.
number
1 or 0
input code This code is put into the neural network which then loads the associated weights, runs the process and sets the output code. The input code can either be changed by other cells or by processes within the program.
number
1 or 0
output code The output from the neural network.
text filename Either the training or weights file. Training files have a .nnt extension, weights files have a .nnw extension.
text cell action Used to bypass the processing of the input code by the neural network.
text emotion this is a code held in tags that is used by the program to store information used by the Emotion routines. Cell 935 holds information used by the emotions routines eg.
<f:42> the number of times the word has been found in an input the number is incremented every time the word is found in the input. If the word count goes above 100 then it is reset to 0. This means the word moves down the list in cell 935.
number node 1 to node
to
node 9 to node
Connects the output nodes to input nodes of other cells. The input node of the target cell is changed when the cell is activated.
number in cell Target cell used when connecting output to input nodes.
text tags During cell activation the tags field is read. Click here for details.
text field 11 General use and extra keywords.
text file or f9 File name where required.
text detail The dictionary description of the word.
number mode

Controls how the input is processed cell 832 is the default settings for the Ai
3, 2008 learning routines are activated, if cell 832 mode=3 then learning is the default
5, translate, translates the cell word with the word in f7 and adds the word
to the output
6, looks for the sentence word in the detail field and then builds up the output from the cell words. This mode uses the last word found so the words in the description will be the most recently added. The number of times words are found means that an output will always be generated, though this output will be random and be void of intellectual translation.
7, puts input into output, bypasses ProcessInput and goes straight to output.

number operation

Activates a system command, these need a command word which is a word with its type field set to 33 proceeding the operation word
1, System command on the file field, field 10 is the extra parameter if needed for executable, field 8 is the reply
2, copy file to filename in field 10 if the type field is 35 then this enforces an absolute order which will enable copy even if the file exists and will be overwritten
3, activate the cell
4, delete file in file field, full path
5 ,move file to the file name in field 10 type field must be 24 if you want to replace an existing file
6, show pictures in file field, full path
11, turn ON digital channel output 1
12, turn ON digital channel output 2
13, turn ON digital channel output 3
14, turn ON digital channel output 4
15, turn ON digital channel output 5
16, turn ON digital channel output 6
17, turn ON digital channel output 7
18, turn ON digital channel output 8
21, turn OFF digital channel output 1
22, turn OFF digital channel output 2
23, turn OFF digital channel output 3
24, turn OFF digital channel output 4
25, turn OFF digital channel output 5
26, turn OFF digital channel output 6
27, turn OFF digital channel output 7
28, turn OFF digital channel output 8

number order

The order field is a bit like operation field but instead of performing system commands its used to carry out functions like combining files and creating html web pages. Sometimes a function word is needed to activate the function, word type 62
0 = unused
1
= unused
2
= unused
2, reply with the contents of 7.
3 reply with the contents of field 8, PR Tags can be used to build the output.

number type

This field is used for word type.
Different word types are processed in different ways by the Ai
The Sentence Code (SC) is created according to the word type of a word in the Brain db the number is used to define the character used to represent the word in the SC. Word types are defined here

text cell word The word associated to the cell.
number cell number The number in the database.
text keyword Brain Keywords
text field 7 Various uses.
text field 8 Various uses.
text field 10 Web addresses and various other uses.
number score, generations, max The score achieved during the last neural network training session, which went though the number of generations up to the maximum number of generations. The more generations the better the score, depending also on complexity of the training data.
text in Used by FIND the string is searched for in the field.
number 0 and 1 training data The cell training data, this is stored in a text file. When the TRAIN button is pressed the neural network is trained using the data. Weights are created and this data is stored as a hidden field in the cell data.

Buttons
IN OUT to TRAIN writes the input and output code to the training data.
TRAIN trains the Neural Network using the training data.
GOTO CELL opens the cell number in the box to the left of the button. If the box is empty then the last cell in the BD is opened.
ADD adds the contents of the box to the right of the button to the BD. A new entry is created and the contents of the new cell are that of the cell currently displayed but with the new cell word.
FIND finds the contents of the box to the left of the button in the field displayed after in.
UP moves up to the next cell, data is saved before the next cell opens.
DOWN moves down to the previous cell, data is saved before the next cell opens.
DEFRAG de fragments the BD if enabled in Settings
CLEAR CELL clears all the fields in the cell.
UPDATE writes the contents of the cell fields to the BD.
ACTIVATE activates the cell.
TO TEXT writes the contents of the cell to the text file NewBrainData.txt in the data folder. This text file can then be used to update the Brain of another Ai. Copy the file into the data folder of the Ai to update then run the keyword UpdateBrain