1 ## Copyright (C) 2005 Michel D. Schmid <michaelschmid@users.sourceforge.net>
4 ## This program is free software; you can redistribute it and/or modify it
5 ## under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2, or (at your option)
9 ## This program is distributed in the hope that it will be useful, but
10 ## WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ## General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program; see the file COPYING. If not, see
16 ## <http://www.gnu.org/licenses/>.
19 ## @deftypefn {Function File} {} saveMLPStruct (@var{net},@var{strFileName})
20 ## @code{saveStruct} saves a neural network structure to *.txt files
23 ## Author: Michel D. Schmid
25 function saveMLPStruct(net,strFileName)
27 ## the variable net holds the neural network structure..
28 # check if "net" is a structure type
29 if !__checknetstruct(net)
30 error("Structure doesn't seem to be a neural network")
33 # open the first level file
34 fid1 = fopen(strFileName,"w+t","ieee-le");
37 error ("Can not open %s", strFileName);
41 # try ## wird nicht mehr benötigt..
42 __printMLPHeader(fid1);
44 # ## Add saveMLPStructure directory to the path and try again
45 # addpath ([fileparts(mfilename()),"/saveMLPStructure"]);
46 # __printMLPHeader(fid1);
49 ## check for field "networkType"
50 __printNetworkType(fid1,net);
52 ## check for field "numInputs"
53 __printNumInputs(fid1,net);
55 ## check for field "numLayers"
56 __printNumLayers(fid1,net)
58 ## check for field "biasConnect"
59 __printBiasConnect(fid1,net)
61 ## check for field "inputConnect"
62 __printInputConnect(fid1,net)
64 ## check for field "layerConnect"
65 __printLayerConnect(fid1,net)
67 ## check for field "outputConnect"
68 __printOutputConnect(fid1,net)
70 ## check for field "targetConnect"
71 __printTargetConnect(fid1,net)
73 ## print one empty line
76 ## check for numOutputs
77 __printNumOutputs(fid1,net);
79 ## check for numTargets
80 __printNumTargets(fid1,net);
82 ## check for numInputDelays
83 __printNumInputDelays(fid1,net);
85 ## check for numLayerDelays
86 __printNumLayerDelays(fid1,net);
88 ## print one empty line
91 ## print subobject structures:
92 fprintf(fid1," subobject structures:\n");
94 ## print one empty line
98 __printInputs(fid1,net);
101 __printLayers(fid1,net);
104 __printOutputs(fid1,net);
107 __printTargets(fid1,net);
110 __printBiases(fid1,net);
112 ## print inputweights
113 __printInputWeights(fid1,net);
115 ## print layerweights
116 __printLayerWeights(fid1,net);
118 ## print one empty line
121 ## print subobject structures:
122 fprintf(fid1," functions:\n");
124 ## print one empty line
128 __printAdaptFcn(fid1,net);
131 __printInitFcn(fid1,net);
134 __printPerformFcn(fid1,net);
137 __printTrainFcn(fid1,net);
139 ## print one empty line
142 ## print subobject structures:
143 fprintf(fid1," parameters:\n");
145 ## print one empty line
149 __printAdaptParam(fid1,net);
152 __printInitParam(fid1,net);
154 ## print performParam
155 __printPerformParam(fid1,net);
158 __printTrainParam(fid1,net);
160 ## print one empty line
163 ## print subobject structures:
164 fprintf(fid1," weight & bias values:\n");
166 ## print one empty line
178 ## print one empty line
181 ## print subobject structures:
182 fprintf(fid1," other:\n");