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 |
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 : |
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 |
|
|
|