54 |
object |
object |
55 |
|
|
56 |
(** |
(** |
|
Displays a string on _channel. |
|
|
*) |
|
|
method toChannel : string -> unit |
|
|
|
|
|
(** |
|
57 |
A set*. |
A set*. |
58 |
Sets the verbosity level in LibNN. |
Sets the verbosity level in LibNN. |
59 |
//FIXME Make a detailed description of what each verbosity level (i.e. |
//FIXME Make a detailed description of what each verbosity level (i.e. |
67 |
*) |
*) |
68 |
method getVerbosity : int |
method getVerbosity : int |
69 |
|
|
70 |
(** |
(** |
71 |
A set*. |
A set*. |
72 |
Sets the random limit for the weights generation |
Sets the random limit for the weights generation |
73 |
*) |
*) |
74 |
method setRandLimit : float -> unit |
method setRandLimit : float -> unit |
75 |
|
|
76 |
(** |
(** |
77 |
A get*. |
A get*. |
78 |
Gets the random limit for the weights generation |
Gets the random limit for the weights generation |
83 |
A set*. |
A set*. |
84 |
Sets the current output channel. |
Sets the current output channel. |
85 |
*) |
*) |
86 |
method setChannel : out_channel -> unit |
method setOutChannel : out_channel -> unit |
87 |
|
|
88 |
(** |
(** |
89 |
A get*. |
A get*. |
90 |
Gets the current output channel. |
Gets the current output channel. |
91 |
*) |
*) |
92 |
method getChannel : out_channel |
method getOutChannel : out_channel |
93 |
|
|
94 |
|
(** |
95 |
|
Displays a string on _outChannel. |
96 |
|
@param module_name |
97 |
|
The name of the module who is speaking (displayed in the output). |
98 |
|
@param msg The message to be displayed. |
99 |
|
*) |
100 |
|
method out : string -> string -> unit |
101 |
|
|
102 |
|
(** |
103 |
|
A set*. |
104 |
|
Sets the current error channel. |
105 |
|
*) |
106 |
|
method setErrChannel : out_channel -> unit |
107 |
|
|
108 |
|
(** |
109 |
|
A get*. |
110 |
|
Gets the current error channel. |
111 |
|
*) |
112 |
|
method getErrChannel : out_channel |
113 |
|
|
114 |
|
(** |
115 |
|
Displays a string on _errChannel. |
116 |
|
@param module_name |
117 |
|
The name of the module who is speaking (displayed in the output). |
118 |
|
@param msg The message to be displayed. |
119 |
|
*) |
120 |
|
method err : string -> string -> unit |
121 |
|
|
122 |
end |
end |
123 |
|
|
138 |
val mutable _randLimit = 2.0 |
val mutable _randLimit = 2.0 |
139 |
|
|
140 |
(** |
(** |
141 |
The channel on which LibNN is supposed to display its information. |
The channel on which LibNN is supposed to display normal information (like |
142 |
|
stdout on Unix). |
143 |
*) |
*) |
144 |
val mutable _channel = stderr |
val mutable _outChannel = stdout |
145 |
|
|
146 |
(** |
(** |
147 |
Displays a string on _channel. |
Sets the current output channel. |
148 |
*) |
*) |
149 |
method toChannel str = |
method setOutChannel newval = |
150 |
Printf.fprintf _channel "%s\n" str |
_outChannel <- newval |
151 |
|
|
152 |
|
(** |
153 |
|
Gets the current output channel. |
154 |
|
*) |
155 |
|
method getOutChannel = |
156 |
|
_outChannel |
157 |
|
|
158 |
|
(** |
159 |
|
Displays a string on _outChannel. |
160 |
|
@param module_name |
161 |
|
The name of the module who is speaking (displayed in the output). |
162 |
|
@param msg The message to be displayed. |
163 |
|
*) |
164 |
|
method out module_name msg = |
165 |
|
let str = |
166 |
|
("[LibNN]: <" ^ module_name ^ "> " ^ msg) in |
167 |
|
Printf.fprintf _outChannel " %s\n" str |
168 |
|
|
169 |
(** |
(** |
170 |
|
The channel on which LibNN is supposed to display errors (like stderr on |
171 |
|
Unix). |
172 |
|
*) |
173 |
|
val mutable _errChannel = stdout |
174 |
|
|
175 |
|
(** |
176 |
|
Sets the current error channel. |
177 |
|
*) |
178 |
|
method setErrChannel newval = |
179 |
|
_errChannel <- newval |
180 |
|
|
181 |
|
(** |
182 |
|
Gets the current error channel. |
183 |
|
*) |
184 |
|
method getErrChannel = |
185 |
|
_errChannel |
186 |
|
|
187 |
|
(** |
188 |
|
Displays a string on _errChannel. |
189 |
|
@param module_name |
190 |
|
The name of the module who is speaking (displayed in the output). |
191 |
|
@param msg The message to be displayed. |
192 |
|
*) |
193 |
|
method err module_name msg = |
194 |
|
let str = |
195 |
|
("[LibNN]: <" ^ module_name ^ "> (ERROR) " ^ msg) in |
196 |
|
Printf.fprintf _errChannel " %s\n" str |
197 |
|
|
198 |
|
(** |
199 |
Sets the current verbosity level. |
Sets the current verbosity level. |
200 |
*) |
*) |
201 |
method setVerbosity newval = |
method setVerbosity newval = |
219 |
method getRandLimit = |
method getRandLimit = |
220 |
_randLimit |
_randLimit |
221 |
|
|
|
(** |
|
|
Sets the current output channel. |
|
|
*) |
|
|
method setChannel newval = |
|
|
_channel <- newval |
|
|
|
|
|
(** |
|
|
Gets the current output channel. |
|
|
*) |
|
|
method getChannel = |
|
|
_channel |
|
|
|
|
222 |
end |
end |
223 |
|
|
224 |
let env : environmentType option ref = ref None |
let env : environmentType option ref = ref None |