The following example program reads the output of the network analyzation program analyze. The output is transformed into a single line with the help of the program analyze.gawk. The net is trained until all patterns are classified correctly:
loadNet ("encoder.net")
loadPattern ("encoder.pat")
initNet ()
while(TRUE)
for i := 1 to 500 do
trainNet ()
endfor
resfile := "test.res"
saveResult (resfile, 1, PAT, FALSE, TRUE, "create")
saveNet("enc1.net")
command := "analyze -s -e WTA -i " + resfile + " | analyze.gawk"
execute(command, w, r, u, e)
print("wrong: ",w, " right: ",r, " unknown: ",u, " error: ",e)
if(right == 100) break
endwhile
The following output is generated:
Net encoder.net loaded Patternset encoder.pat loaded; 1 patternset(s) in memory -> Batchman warning at line 3: Init function and params not specified; using defaults Net initialised Result file test.res written Network file enc1.net written wrong: 87.5 right: 12.5 unknown: 0 error: 7 Result file test.res written Network file enc1.net written wrong: 50 right: 50 unknown: 0 error: 3 Result file test.res written Network file enc1.net written wrong: 0 right: 100 unknown: 0 error: 0