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

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

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