# fully recurrent network

addNet HS-rec -i 5 -t 4 CONTINUOUS
# run 4 "ticks" (unit updates) for each of 5 "intervals"

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

connectGroups input hidden output cleanup output

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

# uniform noise (always toward 0.5) added to input
noiseType input -range 0.2 -uhalf
# don't resample noise every tick
setObj input.applyNoiseOnce 1

# initialize unit inputs and outputs
setObj hidden.initInput -1.0
setObj hidden.initOutput 0.2
setObj output.initInput -1.0
setObj output.initOutput 0.2

loadExamples HS_ex.txt -s train
setObj train.minTime   5.0
setObj train.maxTime   5.0

# no targets before 4.0 (i.e., only apply them for one interval)
setObj train.graceTime 4.0

setObj unitCellSize 40
resetPlot
plotRow * n output 17 b 1 n cleanup 5
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


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]
# 2408
graphObject error
