;;;NETTOOL3 CREATED


(de nettool-net ()
  (let ((layer-1 (new c-layer '("layer-1" (16 65) t () () () () () t) 122 102
                      64 260 ))
        (layer-2 (new c-layer '("layer-2" (8 32) () () () t () () t) 290 112
                      56 224 ))
        (layer-3 (new c-layer '("layer-3" (8 6) () () () t () () t) 430 182
                      104 78 ))
        (layer-4 (new c-layer '("layer-4" (1 10) () t () () () () t) 678 132
                      18 180 )) )
    (new c-connection layer-1 layer-2
         (list ct-tdnn-connect '(1 3) '(1 2)) )
    (new c-connection layer-2 layer-3
         (list ct-tdnn-connect '(1 7) '(1 5)) )
    (new c-connection layer-3 layer-4
         (list ct-connect '(1 1) '(1 1)) ) ) )


(de create-net ()
  (alloc_net (+ 1365 0) (+ 15770 0) (+ 1338 0))
  (build-net-nobias '((layer-1 1040) (layer-2 256) (layer-3 48) (layer-4 10))
                    () )
  ()
  (tdnn-bias-connect layer-2 32 8)
  (tdnn-bias-connect layer-3 6 8)
  (bias-connect layer-4)
  (tdnn-connect layer-1 65 16 layer-2 32 8 2 3)
  (tdnn-connect layer-2 32 8 layer-3 6 8 5 7)
  (connect layer-3 layer-4) )


(de draw-net (l num)
  (let ((window ()))
    (when (null draw-net-window)
      (setq draw-net-window (new-window 800 400 "Network Window")) ) )
  (let ((window draw-net-window))
    (graphics_batch
      (cls)
      (gray_draw_list 122 102 (state layer-1) 16 1.2 -1.2 4)
      (gray_draw_list 290 112 (state layer-2) 8 1.2 -1.2 7)
      (gray_draw_list 430 182 (state layer-3) 8 1.2 -1.2 13)
      (gray_draw_list 678 132 (state layer-4) 1 1.2 -1.2 18) ) ) )
