51 |
Dumps the Time Delay Neural Network specific stuffs as XML. |
Dumps the Time Delay Neural Network specific stuffs as XML. |
52 |
*) |
*) |
53 |
class xmlTdnnVisitor = |
class xmlTdnnVisitor = |
54 |
object |
object(this) |
55 |
inherit [tdNN] xmlVisitor as super |
inherit [tdNN] xmlVisitor |
56 |
|
|
57 |
initializer |
initializer |
58 |
_moduleName <- "TDNN xml import/export" |
_moduleName <- "TDNN xml import/export" |
65 |
(** |
(** |
66 |
Call the method from xmlVisitor which begins the dump. |
Call the method from xmlVisitor which begins the dump. |
67 |
*) |
*) |
68 |
super#beginDump (network :> nn); |
this#beginDump (network :> nn); |
69 |
|
|
70 |
(** |
(** |
71 |
Dump Time Delay Neural Network specific stuffs. |
Dump Time Delay Neural Network specific stuffs. |
72 |
*) |
*) |
73 |
super#openTag "tdnn"; |
this#openTag "tdnn"; |
74 |
super#openTag "tdnn_output_activation"; |
this#openTag "tdnn_output_activation"; |
75 |
super#dump4dArray !(network#getOutputActivation) string_of_float; |
this#dump4dArray !(network#getOutputActivation) string_of_float; |
76 |
super#closeTag "tdnn_output_activation"; |
this#closeTag "tdnn_output_activation"; |
77 |
super#openTag "tdnn_input_sum"; |
this#openTag "tdnn_input_sum"; |
78 |
super#dump4dArray !(network#getInputSum) string_of_float; |
this#dump4dArray !(network#getInputSum) string_of_float; |
79 |
super#closeTag "tdnn_input_sum"; |
this#closeTag "tdnn_input_sum"; |
80 |
super#openTag "tdnn_error"; |
this#openTag "tdnn_error"; |
81 |
super#dump4dArray !(network#getError) string_of_float; |
this#dump4dArray !(network#getError) string_of_float; |
82 |
super#closeTag "tdnn_error"; |
this#closeTag "tdnn_error"; |
83 |
super#openTag "tdnn_weights"; |
this#openTag "tdnn_weights"; |
84 |
super#dump5dArray !(network#getWeights) string_of_float; |
this#dump5dArray !(network#getWeights) string_of_float; |
85 |
super#closeTag "tdnn_weights"; |
this#closeTag "tdnn_weights"; |
86 |
super#openTag "tdnn_gradients"; |
this#openTag "tdnn_gradients"; |
87 |
super#dump5dArray !(network#getGradients) string_of_float; |
this#dump5dArray !(network#getGradients) string_of_float; |
88 |
super#closeTag "tdnn_gradients"; |
this#closeTag "tdnn_gradients"; |
89 |
super#write ("<layer_nb>" ^ (string_of_int network#getLayerNb) ^ "</layer_nb>"); |
this#write ("<layer_nb>" ^ (string_of_int network#getLayerNb) ^ "</layer_nb>"); |
90 |
super#openTag "tdnn_delay"; |
this#openTag "tdnn_delay"; |
91 |
super#dump2dArray !(network#getDelay) string_of_int; |
this#dump2dArray !(network#getDelay) string_of_int; |
92 |
super#closeTag "tdnn_delay"; |
this#closeTag "tdnn_delay"; |
93 |
super#openTag "tdnn_features_nb"; |
this#openTag "tdnn_features_nb"; |
94 |
super#dump2dArray network#getFeaturesNb string_of_int; |
this#dump2dArray network#getFeaturesNb string_of_int; |
95 |
super#closeTag "tdnn_features_nb"; |
this#closeTag "tdnn_features_nb"; |
96 |
super#openTag "tdnn_time_nb"; |
this#openTag "tdnn_time_nb"; |
97 |
super#dump2dArray network#getTimeNb string_of_int; |
this#dump2dArray network#getTimeNb string_of_int; |
98 |
super#closeTag "tdnn_time_nb"; |
this#closeTag "tdnn_time_nb"; |
99 |
super#openTag "tdnn_field_size"; |
this#openTag "tdnn_field_size"; |
100 |
super#dump2dArray network#getFieldSize string_of_int; |
this#dump2dArray network#getFieldSize string_of_int; |
101 |
super#closeTag "tdnn_field_size"; |
this#closeTag "tdnn_field_size"; |
102 |
super#closeTag "tdnn"; |
this#closeTag "tdnn"; |
103 |
|
|
104 |
(** |
(** |
105 |
Call the method from xmlVisitor which finishes the dump. |
Call the method from xmlVisitor which finishes the dump. |
106 |
*) |
*) |
107 |
super#endDump (network :> nn) |
this#endDump (network :> nn) |
108 |
|
|
109 |
end |
end |