1 |
|
(****************************************************************** |
2 |
|
[LibNN - Neural Networks Library] |
3 |
|
http://libnn.org |
4 |
|
Copyright (C) 2002 - 2003 LAGACHERIE Matthieu RICORDEAU Olivier |
5 |
|
|
6 |
|
This program is free software; you can redistribute it and/or |
7 |
|
modify it under the terms of the GNU General Public License |
8 |
|
as published by the Free Software Foundation; either version 2 |
9 |
|
of the License, or (at your option) any later version. This |
10 |
|
program is distributed in the hope that it will be useful, |
11 |
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
|
GNU General Public License for more details. You should have |
14 |
|
received a copy of the GNU General Public License |
15 |
|
along with this program; if not, write to the Free Software |
16 |
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
17 |
|
USA. |
18 |
|
|
19 |
|
SPECIAL NOTE (the beerware clause): |
20 |
|
This software is free software. However, it also falls under the beerware |
21 |
|
special category. That is, if you find this software useful, or use it |
22 |
|
every day, or want to grant us for our modest contribution to the |
23 |
|
free software community, feel free to send us a beer from one of |
24 |
|
your local brewery. Our preference goes to Belgium abbey beers and |
25 |
|
irish stout (Guiness for strength!), but we like to try new stuffs. |
26 |
|
|
27 |
|
Authors: |
28 |
|
LAGACHERIE Matthieu |
29 |
|
Paper mail : 7 rue Delescluzes 94280 LE KREMLIN BICETRE, FRANCE |
30 |
|
E-mail : matthieu@libnn.org |
31 |
|
|
32 |
|
RICORDEAU Olivier |
33 |
|
Paper mail : 69 avenue d'Italie 75013 PARIS, FRANCE |
34 |
|
E-mail : olivier@libnn.org |
35 |
|
|
36 |
|
*****************************************************************) |
37 |
|
|
38 |
|
(** |
39 |
|
Test program for the XmlVisitor module. |
40 |
|
|
41 |
|
@author Olivier Ricordeau |
42 |
|
@since 09/08/2003 |
43 |
|
*) |
44 |
|
|
45 |
|
|
46 |
|
open Env |
47 |
open MlpNN |
open MlpNN |
48 |
open TdNN |
open TdNN |
49 |
open XmlMlpnnVisitor |
open XmlMlpnnVisitor |
52 |
let write msg = |
let write msg = |
53 |
Printf.fprintf stdout "%s\n" msg |
Printf.fprintf stdout "%s\n" msg |
54 |
|
|
55 |
(* Create xml files for tdnn and mlpnn *) |
(** |
56 |
|
Create xml files for tdnn and mlpnn |
57 |
|
*) |
58 |
let _ = |
let _ = |
59 |
write " (* Testing XML import/export ... *)"; |
write " + (* Testing XML import/export ... *)"; |
60 |
write " + Creating an empty TDNN, and dumping it as `tdnn.xml'."; |
write " + Creating an empty TDNN, and dumping it as `tdnn.xml'."; |
61 |
let empty_mlpnn = new mlpNN and |
let empty_mlpnn = new mlpNN and |
62 |
mlpnnvis = new xmlMlpnnVisitor in |
mlpnnvis = new xmlMlpnnVisitor and |
63 |
|
verbosity = 4 |
64 |
|
in |
65 |
|
(Env.getEnv())#setVerbosity verbosity; |
66 |
mlpnnvis#setOverwriteFile true; |
mlpnnvis#setOverwriteFile true; |
67 |
mlpnnvis#setFileName "mlpnn.xml"; |
mlpnnvis#setFileName "mlpnn.xml"; |
68 |
mlpnnvis#visit empty_mlpnn; |
mlpnnvis#visit empty_mlpnn; |
69 |
write " + Creating an empty MLPNN, and dumping it as `mlpnn.xml'."; |
write " + Creating an empty MLPNN, and dumping it as `mlpnn.xml'."; |
70 |
let tdnn = new tdNN and |
let empty_tdnn = new tdNN and |
71 |
tdnnvis = new xmlTdnnVisitor in |
tdnnvis = new xmlTdnnVisitor in |
72 |
|
(Env.getEnv())#setVerbosity verbosity; |
73 |
tdnnvis#setOverwriteFile true; |
tdnnvis#setOverwriteFile true; |
74 |
tdnnvis#setFileName "tdnn.xml"; |
tdnnvis#setFileName "tdnn.xml"; |
75 |
tdnnvis#visit tdnn; |
tdnnvis#visit empty_tdnn; |
76 |
(* Then, validate them. *) |
(** |
77 |
write " + validating `tdnn.xml'."; |
Then, validate them. |
78 |
let mlpnn = new mlpNN and |
*) |
79 |
mlpnnvis = new xmlMlpnnVisitor in |
write " + validating `tdnn.xml'."; |
80 |
mlpnnvis#setFileName "mlpnn.xml"; |
let mlpnn = new mlpNN and |
81 |
let extracted_mlpnn = mlpnnvis#xml2Nn in |
mlpnnvis = new xmlMlpnnVisitor in |
82 |
(); |
(Env.getEnv())#setVerbosity verbosity; |
83 |
write " + validating `mlpnn.xml'."; |
mlpnnvis#setFileName "mlpnn.xml"; |
84 |
let tdnn = new tdNN and |
let extracted_mlpnn = mlpnnvis#xml2Nn in |
85 |
tdnnvis = new xmlTdnnVisitor in |
(); |
86 |
tdnnvis#setFileName "tdnn.xml"; |
write " + validating `mlpnn.xml'."; |
87 |
let tdnn = tdnnvis#xml2Nn in |
let tdnn = new tdNN and |
88 |
write " (* Test successful. *)" |
tdnnvis = new xmlTdnnVisitor in |
89 |
|
(Env.getEnv())#setVerbosity verbosity; |
90 |
|
tdnnvis#setFileName "tdnn.xml"; |
91 |
|
let tdnn = tdnnvis#xml2Nn in |
92 |
|
write " + (* Test successful. *)" |
93 |
|
|