/[marvin]/marvin/src/libnn/propagate/propagateTdnnVisitor.ml
ViewVC logotype

Diff of /marvin/src/libnn/propagate/propagateTdnnVisitor.ml

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

revision 1.3 by srv89, Wed Sep 10 11:32:19 2003 UTC revision 1.4 by matthieu, Wed Sep 10 18:02:33 2003 UTC
# Line 52  open TdNN Line 52  open TdNN
52  class propagateTdnnVisitor =  class propagateTdnnVisitor =
53  object  object
54    inherit [tdNN] propagateVisitor    inherit [tdNN] propagateVisitor
   
   initializer  
     _moduleName <- "TDNN propagation"  
                       
55    val mutable _transfertFunction = function x -> (1. /. (1. +. exp (-.x)))    val mutable _transfertFunction = function x -> (1. /. (1. +. exp (-.x)))
       
56    method visit (network : tdNN) =    method visit (network : tdNN) =
57      let step = network#getStep and      let step = network#getStep and
58        transFun = _transfertFunction and      transFun = _transfertFunction and
59        outputActivation = network#getOutputActivation and      outputActivation = network#getOutputActivation and
60        inputSum = network#getInputSum and      inputSum = network#getInputSum and
61        weights = network#getWeights and      weights = network#getWeights and
62        delay = network#getDelay and      delay = network#getDelay and
63        stepDelay = ref 0 in      stepDelay = ref 0 in
64        begin        begin
65          (**          (**
66            Activation of the input layer.            Activation of the input layer.
67          *)          *)
68          for i = 0 to (network#getFeaturesNb.(0)) - 1 do          for i = 0 to (network#getFeaturesNb 0) - 1 do
69            for j = 0 to (network#getTimeNb.(0)) - 1 do            for j = 0 to (network#getTimeNb 0) - 1 do
70              !outputActivation.(0).(i).(j) <- transFun !inputSum.(0).(i).(j)              !outputActivation.(0).(i).(j) <- transFun !inputSum.(0).(i).(j)
71            done            done
72          done;          done;
# Line 85  object Line 80  object
80            stepDelay used to keep the delay concept            stepDelay used to keep the delay concept
81          *)          *)
82          for l = 0 to network#getLayerNb - 2 do          for l = 0 to network#getLayerNb - 2 do
83            for i = 0 to (network#getFeaturesNb.(l + 1)) - 1 do            for i = 0 to (network#getFeaturesNb (l + 1)) - 1 do
84              for j = 0 to (network#getTimeNb.(l + 1)) - 1 do              for j = 0 to (network#getTimeNb (l + 1)) - 1 do
85                !inputSum.(l + 1).(i).(j) <- 0.;                !inputSum.(l + 1).(i).(j) <- 0.;
86                for k = 0 to (network#getFeaturesNb.(l)) - 1 do                for k = 0 to (network#getFeaturesNb l) - 1 do
87                  for m = !stepDelay to (!stepDelay + !delay.(l)) - 1 do                  for m = !stepDelay to (!stepDelay + !delay.(l)) - 1 do
88                    !inputSum.(l + 1).(i).(j) <- !inputSum.(l + 1).(i).(j)                    !inputSum.(l + 1).(i).(j) <- !inputSum.(l + 1).(i).(j)
89                    +. !outputActivation.(l).(k).(l + !stepDelay)                    +. !outputActivation.(l).(k).(l + !stepDelay)
# Line 103  object Line 98  object
98            stepDelay := 0            stepDelay := 0
99          done          done
100        end        end
   
101  end  end

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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