/[marvin]/marvin/src/libnn/input/inputTdnnVisitor.ml
ViewVC logotype

Diff of /marvin/src/libnn/input/inputTdnnVisitor.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by srv89, Wed Sep 10 11:32:19 2003 UTC revision 1.7 by matthieu, Wed Sep 10 18:02:33 2003 UTC
# Line 43  Line 43 
43    @since 10/08/2003    @since 10/08/2003
44  *)  *)
45    
46    (**
47      Needed for random number generation.
48    *)
49    open Random
50    
51  open Nn  open Nn
52  open InputVisitor  open InputVisitor
53  open DefaultVisitor  open DefaultVisitor
# Line 52  class inputTdnnVisitor = Line 57  class inputTdnnVisitor =
57  object  object
58    inherit [tdNN] inputVisitor    inherit [tdNN] inputVisitor
59    
   initializer  
     _moduleName <- "TDNN input layer activation"  
   
60    (**    (**
61      The method which activate the input layer.      The method which activate the input layer.
62      The activation of the Tdnn can be done with several methods :      The activation of the Tdnn can be done with several methods :
# Line 71  object Line 73  object
73      let inputSum = network#getInputSum and      let inputSum = network#getInputSum and
74        inputLearnVector = network#getInputLearnVector in        inputLearnVector = network#getInputLearnVector in
75        match (!inputSum, inputLearnVector) with        match (!inputSum, inputLearnVector) with
76            (a, b) when            (a, b) when (Array.length a.(0) * Array.length a.(0).(0)) != Array.length inputLearnVector
77              (Array.length a.(0) * Array.length a.(0).(0)) !=              -> (Env.getEnv())#toChannel "Class inputTdnnVisitor : The inputSum and the inputLearnVector haven't the same size, I stop here.\n"
             Array.length inputLearnVector  
             -> (Env.getEnv())#err "tdnn/input"  
               "inputSum and inputLearnVector don't have the same size. skipping task." 1  
78          | _ ->          | _ ->
79              begin              begin
80                for i = 0 to network#getLayerNb - 1 do                for i = 0 to network#getLayerNb - 1 do
81                  for j = 0 to (network#getFeaturesNb.(i)) - 1 do                  for j = 0 to (network#getFeaturesNb i) - 1 do
82                    for k = 0 to (network#getTimeNb.(i)) - 1 do                    for k = 0 to (network#getTimeNb i) - 1 do
83                      !inputSum.(i).(j).(k) <- inputLearnVector.(i + j + k)                      !inputSum.(i).(j).(k) <- inputLearnVector.(i + j + k)
84                    done                    done
85                  done                  done
86                done                done
87              end              end
   
88  end  end
     

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26