General Information

Spud Ai

General Information

The main Ai window consists of 3 text boxes and 3 buttons. Starting from the top the first text box shows various information that scrolls up as inputs are processed. The middle box is a edit box and shows the output. The bottom box is an edit box and is the input box, words typed in here will be grabbed by the Ai processed then the output sent to the middle output box

Autoexec
When the program starts the Ai reads cell 814. It is usually called autoexec. Field 8 is put into the input. The Mode field controls how subsequent inputs are translated this should bet set at 0 unless you want all inputs translated in a different mode. Mode switches can still occur during translation.

Search
The search routine is designed to do different jobs depending and the algorithm that is using it.
RAS uses the routine most so it is advisable to have the number of files searched limited to an acceptable amount depending on how fast the response is required.
The file in cell 819 field 11 is the file name of the file that holds the file names of the files to search each time by the RAS routine.
If you want to have a large number of files searched and don't want the RAS routine to search all files each translation then it is best to use a different search file. If you use the keyword searchinfofile for a pattern then the file field is the file holding the file names that will searched. This allows for different search criteria depending on what has been activated from the translation. You could have a search file full of say html file names that is used when the pattern for say 'search html for fish' is entered into the input.

Effect on system performance
Some of the routines in the program can put a heavy strain on the computer system resources. The effect on resources is controlled by how you have it set to process eg. if you have hundreds of files used as a resource for the RAS routine then hadrdrive access speed will have a major impact on the amount of time to process. If the RQ weight of any routine is set to 0 then that process is ignored during processing of inputs. Here is a brief summary of the routines and the effect on system resources only routines that have any noticeable effect are included. As the Brain Database gets bigger it will take longer to search but no effect has been noticed on a Brain with over 7000 entries
QNV this uses the TF but also does allot of deep scanning and if set to its highest scan level can start to use allot of CPU
RAS there is no limit on the number of files that can be used to search by the RAS routine these files are held on the hard drive hard drive speed effects performance use fewer files to process inputs faster.
P, Pattern this routine uses some of the same search functions as RAS
WSB when on this puts a heavy load on the CPU the WSB routine works as a separate process and attempts to run as fast as possible, the faster the better as this increases the sample rate, the routine uses the analogue input channel from the USB card, the better the sample rate the better the word association.
SE search engine this sends off a search request and slows down the internet connection it has no effect on the Ai because it runs as a separate thread
NNE this routine loads weights from text files the bigger and more complex the matrix of cells the the bigger effect on hard drive and CPU
NNE6P or 6P this digs deep into the NNE data base following words connected to other words looking for connections the more words and the more connections the longer it takes. If 6P learning is ticked the learning routine compares every word in the NNE with every description of words in the TF this means millions of requests are made to the TF it takes about 16 seconds to process 1.4 million requests NNE6P words start at entry 2000 in the NNE database. The whole database is loaded into memory so speed of memory and CPU are affected.
The keyword lowpower turns off the WSB and SE routines

DMX control
The dll K8062D.dll is used to operate the USB to DMX controller. The Velleman K8062 is available from Maplins.
NNE cells 1511 to 1765 correspond to DMX output channels 1 to 254

Function Check
The following are ways of checking each algorithm to see if they are set up correctly and working properly
QI Question and Is
input: what is a dog
answer from QI: Dog is noun four legged flesh eating animal akin to the fox and wolf and of many breeds
QNV Question Noun Verb
input: how do fish swim
answer from QNV: I think that fish is animal swim with fins with living with water.
PR Pattern Recognition and SC Sentence Code
Tick SC learning in settings, set STM Short Term Memory to 4 then
input: nothing happened
put the phrase in around 4 times until the STM adds the pattern to the end of the BD Brain Database.
When added to the BD the Pattern is a Sentence Code and sends an output if there is an exact match to change the SC to a PC change the cells type from 32 to 60
put into field 11: did <%> happen now?
press UPDATE
now input: nothing happened yet
output should be: Did nothing happen now?.
DT Deeper Thought
Type something into the input box, when processing has finished change the answer in the output box then press OK or ENTER. The routine will create new training data, re-train the relative cells neural networks and create new connections between cells.
Typing the same sentence in should produce the re-trained response.

RQW Reply Quality Weight
The value of the ReplyQualityWeight is generated by how well the Ai thinks its understanding the inputs, the value increases if the outputs have on average a good reply quality and in reverse decreases if the Ai produces bad outputs. The color of the word TIMER in the top left hand corner is changed according to the
ReplyQualityWeight value

De fragmenting
This process organizes the data into groups so each process only needs to access data that it uses. This process runs at startup if new data has been added. This speeds up searches. Training files updated and node connections are reassigned to the new cell entries. Tag references to cells are also updated. There are some situations where tags cell calls become unstable a fix for this is to tick disable defrag in settings. New data will be added to the end of the database which is also searched by all processes as well as searching there own relevant part in the database. After a few thousand new entries you may start to notice processing speed slow down more than normally would happen if the defrag function is enabled.

Process order
this list is the order of processes starting from main timer activation

timer 1 activates
marker put scrole output ****
Act On d inputs
read analog inputs
timer 2
stuff on timer
   
  update brain with number in outs
check entries 1000 to 2000 for changes
Play list Kick start
check digital counters and activate cells accordingly
check Read File To Input
timer loop
 
    Save brain every hour
do udp
play list kick start
show images
do 6p learning if on
update date time in brain
check alarm
check for brain errors
activate cells that do so on timer loop
  read message
do udp
activate cells that do so on timer
 
grab text from input box
input filter
update date time
some learning
visual stuff
do udp
   
  process input most controlled by rq in settings
Dissect input and setup variables
Sentence type
emotion
3 learning processes
special sentence code function
look for patterns
translate using brain
QNV
RAS
search engine
expected in input both types
short term memory
more pattern recognition
subject and subject new
Parameters
wheatstone bridge
6p
neural network
neural network backward
neural network deeper thought
neural network cell numbers at one
neural network dig in deeper
auto learning
face
 
check output
choose answer
output filter
say print send the output to various places
check for brain changes
do udp
add to short term memory
gap in time
r2 d2 vocalization
reset variables and restart main timer
   

Other programs used by the Ai
Ai Server
AiServer.exe is a tcp/ip server that works as a standard web server. Its a very simple server and only serves pages with the extension .html it wont serve images or any other type of file. Its designed to send information to the Ai via a web page form. The server binds to the ip address if 0.0.0.0 then it binds to any incoming ip address. The port number is normally set to port 80 the usual for a web server. Incoming packets are sent to the window name usually set to the Ai's name this then processes the string and sends it back to the server which then sends it to the client.
Only files in the server programs folder with the extension .html are served.
The server first sends the page index.html then the main.html
To access the server enter the machine the server is running on ip number or host name DONT add the file name this will override the Ai output and you wont get the Ai response even though you are served the page eg. on my machine
start the server
open web browser
type in the address http://zip
zip is the name of my machine change the name to the name of your computer
you should see the index page the address bar should read http://zip/
press the button
the page will Wait until the message has been sent to the Ai processed then sent back. If there is no response after 30 seconds the server will timeout and the index page will be sent. The timeout is adjusted once communication is established.

If aicell is in the input then the words "cell activated" is sent immediately in reply the server sends a the reply just after sending the message to the ai the reply from the ai is ignored. This is used so form button can send a message quickly but also it stops the need to create an answer from a cell activation.
The code for the web page is: aicell1234pw where 1234 is the cell to activate. This code was created for the robot remote control.
To see DeBug outputs add /debug to the web address this will cause the server to send more information to a debug program running on the same machine as the server.
If the window message from the ai to the server has the words send: in it then the words after is the web page file name to send eg. send:results.html will cause the server to send the results page rather than the usual main.html web page.

aicode123 is a way of sending a code to the ai keeping the code in the message. Its used for buttons e.g.
<input type="submit" name="aicode001" value=" TEST CODE ">
this will send the contents of the edit box followed by the code in the same way as SEARCH FOR does. Normally a
button press will only send the contents of the edit box. If the edit box is empty then the button name and label
are sent instead

Tags are used in the served page to insert information
<aireply> inserts the reply from the Ai before serving the page. The tag must be on a line of its own to stop weard things being added, the whole line containing
<aireply> is replaced with the output from the Ai.
<file=filename> This tag inserts the contents of a file into the page. Filename is the full path location of the file to insert into the page.

Ai K8055 Interface
AiK8055InterfaceV002.exe is used to read inputs from the K8055 card and transmit the data to cells in the Ai. Card address is a number 1 to 4 and is the card number to connect to. 4 cards can be connected to a PC a single card can be connected to by many instances of the program.
Timer length is the time in millisecond between card reads.
TX switches on transmission to the Ai
To cell values are the cell numbers in the Ai to set input codes are updated.
Activate if ticked the cell is activated after the input code has been set.
On change the data is only transmitted if there has been a change in the value since the last read.
Window name is the name of the window to transmit data to usually the name of the Ai running on the same machine.
CARD when pressed the program attempts to connect to the card numbered in the Card address box.
START starts the program timer sampling data at a rate according to the value in Timer length
Auto start if ticked then the card is opened and the timer started automatically at program start up
Notifications at the bottom of the screen give information. Count is the number of times the timer has triggered it resets at 1000000
Click is the data being sent Click 5 is D3 4 5 to cell etc.
When the program closes the data is saved in a text file called AiK8055.txt this is read when the program starts and the values are loaded into the fields.
The rate in which the Ai can receive information is dependant on the speed of the Ai timer as well as the Interface timer speed

Download file
dlf.exe is used to download a file from a server.

Ai Encript
AiEncript02.exe this program encript's text files. Make sure the decript is correct before deleting the original as some files can corrupt the encript process. The Encript process can be activated if it receives a Window message

Ai Capture
AiCapture03.exe This program is used to capture images from a web cam. When the program receives a window message then it saves a
snapshot image called 00001.bmp in the image folder this can then be used by the Ai usually using the keyword ImageLoadScan then ImageScanFunctions to process the image. The keyword CopyFileNewName can be used to copy and rename the captured image. Useful if you want to keep all the images. Each new image has a number that is incremented for its filename.