;;;NETTOOL3 CREATED


(de nettool-net ()
  (let ((input (new c-layer '("input" (16 16) t () () () () () t) 52 102 112
                    112 ))
        (hidden-1 (new c-layer '("hidden-1" (8 8) () () t () () () t) 255 62
                       80 80 ))
        (hidden-2 (new c-layer '("hidden-2" (8 8) () () t () () () t) 255 152
                       80 80 ))
        (prepro-1 (new c-layer '("prepro-1" (4 4) () () t () () () t) 440.195
                       42 60 60 ))
        (prepro-2 (new c-layer '("prepro-2" (4 4) () () t () () () t) 440.195
                       112 60 60 ))
        (prepro-3 (new c-layer '("prepro-3" (4 4) () () t () () () t) 440.195
                       182 60 60 ))
        (prepro-4 (new c-layer '("prepro-4" (4 4) () () t () () () t) 440.195
                       252 60 60 ))
        (output (new c-layer '("output" (1 10) () t () () () t ()) 634.195 102
                     19 190 )) )
    (new c-connection input hidden-1
         (list ct-mask-toric-connect '(3 3) '(2 2)) )
    (new c-connection input hidden-2
         (list ct-mask-toric-connect '(3 3) '(2 2)) )
    (new c-connection hidden-1 prepro-1
         (list ct-mask-toric-connect '(3 3) '(2 2)) )
    (new c-connection hidden-1 prepro-2
         (list ct-mask-toric-connect '(3 3) '(2 2)) )
    (new c-connection hidden-1 prepro-3
         (list ct-mask-toric-connect '(3 3) '(2 2)) )
    (new c-connection hidden-1 prepro-4
         (list ct-mask-toric-connect '(3 3) '(2 2)) )
    (new c-connection hidden-2 prepro-1
         (list ct-mask-toric-connect '(3 3) '(2 2)) )
    (new c-connection hidden-2 prepro-2
         (list ct-mask-toric-connect '(3 3) '(2 2)) )
    (new c-connection hidden-2 prepro-3
         (list ct-mask-toric-connect '(3 3) '(2 2)) )
    (new c-connection hidden-2 prepro-4
         (list ct-mask-toric-connect '(3 3) '(2 2)) )
    (new c-connection prepro-1 output
         (list ct-connect '(1 1) '(1 1)) )
    (new c-connection prepro-2 output
         (list ct-connect '(1 1) '(1 1)) )
    (new c-connection prepro-3 output
         (list ct-connect '(1 1) '(1 1)) )
    (new c-connection prepro-4 output
         (list ct-connect '(1 1) '(1 1)) ) ) )


(de create-net ()
  (alloc_net (+ 469 0) (+ 3146 0) (+ 746 0))
  (build-net-nobias '((input 256) (hidden-1 64) (hidden-2 64) (prepro-1 16)
                      (prepro-2 16) (prepro-3 16) (prepro-4 16) (output 10) )
                    () )
  ()
  (shared-bias-connect hidden-1)
  (shared-bias-connect hidden-2)
  (shared-bias-connect prepro-1)
  (shared-bias-connect prepro-2)
  (shared-bias-connect prepro-3)
  (shared-bias-connect prepro-4)
  (bias-connect output)
  (mask-toric-connect input 16 16 hidden-1 8 8 2 2 3 3)
  (mask-toric-connect input 16 16 hidden-2 8 8 2 2 3 3)
  (mask-toric-connect hidden-1 8 8 prepro-1 4 4 2 2 3 3)
  (mask-toric-connect hidden-1 8 8 prepro-2 4 4 2 2 3 3)
  (mask-toric-connect hidden-1 8 8 prepro-3 4 4 2 2 3 3)
  (mask-toric-connect hidden-1 8 8 prepro-4 4 4 2 2 3 3)
  (mask-toric-connect hidden-2 8 8 prepro-1 4 4 2 2 3 3)
  (mask-toric-connect hidden-2 8 8 prepro-2 4 4 2 2 3 3)
  (mask-toric-connect hidden-2 8 8 prepro-3 4 4 2 2 3 3)
  (mask-toric-connect hidden-2 8 8 prepro-4 4 4 2 2 3 3)
  (connect prepro-1 output)
  (connect prepro-2 output)
  (connect prepro-3 output)
  (connect prepro-4 output) )


(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 52 102 (state input) 16 1.2 -1.2 7)
      (gray_draw_list 255 62 (state hidden-1) 8 1.2 -1.2 10)
      (gray_draw_list 255 152 (state hidden-2) 8 1.2 -1.2 10)
      (gray_draw_list 440 42 (state prepro-1) 4 1.2 -1.2 15)
      (gray_draw_list 440 112 (state prepro-2) 4 1.2 -1.2 15)
      (gray_draw_list 440 182 (state prepro-3) 4 1.2 -1.2 15)
      (gray_draw_list 440 252 (state prepro-4) 4 1.2 -1.2 15)
      (draw_list 634 102 (state output) 1 1.2 19 17) ) ) )
