about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/netlab3.3/convertoldnet.m
blob: bf281c832f62f92f9712252c462d96ccc93f6acf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function net = convertoldnet(net)
%CONVERTOLDNET Convert pre-2.3 release MLP and MDN nets to new format
%
%	Description
%	NET = CONVERTOLDNET(NET) takes a network NET and, if appropriate,
%	converts it from pre-2.3 to the current format.  The difference is
%	simply  that in MLPs and the MLP sub-net of MDNs the field ACTFN has
%	been  renamed OUTFN to make it consistent with GLM and RBF networks.
%	If the network is not old-format or an MLP or MDN it is left
%	unchanged.
%
%	See also
%	MLP, MDN
%

%	Copyright (c) Ian T Nabney (1996-2001)

switch net.type
    case 'mlp'
	if (isfield(net, 'actfn'))
	    net.outfn = net.actfn;
	    net = rmfield(net, 'actfn');
	end
    case 'mdn'
	net.mlp = convertoldnet(net.mlp);
end