# standard feedforward network

addNet HS-ff

addGroup input   28 INPUT OUT_NOISE
addGroup hidden  10
addGroup output  68 OUTPUT

connectGroups input hidden output

# seed random number generator
seed 12345
# randomize weights
resetNet
loadWeights HS-ff.init.wt

# uniform noise (always toward 0.5) added to input
noiseType input -uhalf
proc noiseOn  {} { setObj input.noiseRange 0.2 }
proc noiseOff {} { setObj input.noiseRange 0.0 }
noiseOff

loadExamples HS_ex.txt -s train

setObj unitCellSize 40
resetPlot
plotRow * n output 17
plotRow 1 f
plotRow * n hidden 20
plotRow 1 f
plotRow  n input 11
plotRow  n input 5
plotRow  n input 10
plotRow  n input 2
drawUnits

# not currently being used
proc addHidden { n } {
addGroup hidden2 $n
connectGroups input hidden2 output
orderGroups input hidden hidden2 output
resetPlot
plotRow * n output 17
plotRow 1 f
plotRow * n hidden2 20
plotRow * n hidden 20
plotRow 1 f
plotRow  n input 11
plotRow  n input 5
plotRow  n input 10
plotRow  n input 2
drawUnits
}


setObj input.unit(0).name  b/1
setObj input.unit(1).name  c/1	
setObj input.unit(2).name  d/1	
setObj input.unit(3).name  g/1	
setObj input.unit(4).name  h/1	
setObj input.unit(5).name  l/1	
setObj input.unit(6).name  m/1	
setObj input.unit(7).name  n/1	
setObj input.unit(8).name  p/1	
setObj input.unit(9).name  r/1	
setObj input.unit(10).name t/1	
setObj input.unit(11).name a/2	
setObj input.unit(12).name e/2	
setObj input.unit(13).name i/2	
setObj input.unit(14).name o/2	
setObj input.unit(15).name u/2	
setObj input.unit(16).name b/3	
setObj input.unit(17).name c/3	
setObj input.unit(18).name d/3	
setObj input.unit(19).name g/3	
setObj input.unit(20).name n/3	
setObj input.unit(21).name m/3	
setObj input.unit(22).name p/3	
setObj input.unit(23).name r/3	
setObj input.unit(24).name t/3	
setObj input.unit(25).name w/3	
setObj input.unit(26).name e/4	
setObj input.unit(27).name k/4	

setObj learningRate 0.2
setObj numUpdates 1000
echo "numLinks =" [getObj numLinks]
# 1038
graphObject error
