32 |
|
|
33 |
@author Matthieu Lagacherie |
@author Matthieu Lagacherie |
34 |
@author Olivier Ricordeau |
@author Olivier Ricordeau |
35 |
@since 10/08/2003 |
@since 07/28/2003 |
36 |
*) |
*) |
37 |
|
|
38 |
open Nn |
open Nn |
41 |
class tdNN = |
class tdNN = |
42 |
object (self : 'a) |
object (self : 'a) |
43 |
inherit [('a) defaultVisitor] nn |
inherit [('a) defaultVisitor] nn |
44 |
|
|
45 |
val _networkType = "TDNN" |
val _networkType = "TDNN" |
46 |
|
|
47 |
val mutable _outputActivation = [|[|[|0.0|]|]|] |
val mutable _outputActivation = [|[|[|0.0|]|]|] |
48 |
|
|
49 |
val mutable _inputSum = [|[|[|0.0|]|]|] |
val mutable _inputSum = [|[|[|0.0|]|]|] |
50 |
|
|
51 |
val mutable _error = [|[|[|0.0|]|]|] |
val mutable _error = [|[|[|0.0|]|]|] |
52 |
|
|
53 |
val mutable _weights = [|[|[|[|0.0|]|]|]|] |
val mutable _weights = [|[|[|[|0.0|]|]|]|] |
54 |
|
|
55 |
val mutable _gradients = [|[|[|[|0.0|]|]|]|] |
val mutable _gradients = [|[|[|[|0.0|]|]|]|] |
56 |
|
|
57 |
val mutable _layerNb = 0 |
val mutable _layerNb = 0 |
58 |
|
|
59 |
val mutable _delay = [|0|] |
val mutable _delay = [|0|] |
60 |
|
|
61 |
val mutable _featuresNb = [|0|] |
val mutable _featuresNb = [|0|] |
62 |
|
|
63 |
val mutable _timeNb = [|0|] |
val mutable _timeNb = [|0|] |
64 |
|
|
65 |
val mutable _fieldSize = [|0|] |
val mutable _fieldSize = [|0|] |
66 |
|
|
67 |
(** |
(** |
68 |
The generic method accept |
The generic accept method. |
69 |
*) |
*) |
70 |
method accept (visitor : ('a) defaultVisitor) = visitor#visit self |
method accept (visitor : ('a) defaultVisitor) = |
71 |
|
visitor#visit self |
72 |
|
|
73 |
(** |
(** |
74 |
Accessors get |
|
75 |
*) |
*) |
76 |
method getOutputActivation = ref _outputActivation |
method getOutputActivation = |
77 |
method getInputSum = ref _inputSum |
ref _outputActivation |
78 |
method getError = ref _error |
|
79 |
method getWeights = ref _weights |
method getInputSum = |
80 |
method getGradients = ref _gradients |
ref _inputSum |
81 |
method getLayerNb = _layerNb |
|
82 |
method getDelay layer = _delay.(layer) |
method getError = |
83 |
method getFeaturesNb layer = _featuresNb.(layer) |
ref _error |
84 |
method getTimeNb layer = _timeNb.(layer) |
|
85 |
method getFieldSize layer = _fieldSize.(layer) |
method getWeights = |
86 |
method getNetworkType = _networkType |
ref _weights |
87 |
|
|
88 |
|
method getGradients = |
89 |
|
ref _gradients |
90 |
|
|
91 |
|
method getLayerNb = |
92 |
|
_layerNb |
93 |
|
|
94 |
|
method getDelay layer = |
95 |
|
_delay.(layer) |
96 |
|
|
97 |
|
method getFeaturesNb layer = |
98 |
|
_featuresNb.(layer) |
99 |
|
|
100 |
|
method getTimeNb layer = |
101 |
|
_timeNb.(layer) |
102 |
|
|
103 |
|
method getFieldSize layer = |
104 |
|
_fieldSize.(layer) |
105 |
|
|
106 |
|
method getNetworkType = |
107 |
|
_networkType |
108 |
|
|
109 |
(** |
(** |
110 |
Accessors set |
Accessors set |
111 |
*) |
*) |
112 |
method setOutputActivation outputActivation = _outputActivation <- outputActivation |
method setOutputActivation outputActivation = |
113 |
method setInputSum inputSum = _inputSum <- inputSum |
_outputActivation <- outputActivation |
114 |
method setError error = _error <- error |
|
115 |
method setWeights weights = _weights <- weights |
method setInputSum inputSum = |
116 |
method setGradients gradients = _gradients <- gradients |
_inputSum <- inputSum |
117 |
method setLayerNb layerNb = _layerNb <- layerNb |
|
118 |
method setDelay delay = _delay <- delay |
method setError error = |
119 |
method setFeaturesNb featuresNb = _featuresNb <- featuresNb |
_error <- error |
120 |
method setTimeNb timeNb = _timeNb <- timeNb |
|
121 |
method setFieldSize fieldSize = _fieldSize <- fieldSize |
method setWeights weights = |
122 |
method setInputActivation inputSumActivation = _inputSum.(0) <- inputSumActivation |
_weights <- weights |
123 |
|
|
124 |
|
method setGradients gradients = |
125 |
|
_gradients <- gradients |
126 |
|
|
127 |
|
method setLayerNb layerNb = |
128 |
|
_layerNb <- layerNb |
129 |
|
|
130 |
|
method setDelay delay = |
131 |
|
_delay <- delay |
132 |
|
|
133 |
|
method setFeaturesNb featuresNb = |
134 |
|
_featuresNb <- featuresNb |
135 |
|
|
136 |
|
method setTimeNb timeNb = |
137 |
|
_timeNb <- timeNb |
138 |
|
|
139 |
|
method setFieldSize fieldSize = |
140 |
|
_fieldSize <- fieldSize |
141 |
|
|
142 |
|
method setInputActivation inputSumActivation = |
143 |
|
_inputSum.(0) <- inputSumActivation |
144 |
|
|
145 |
end |
end |