about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/nethelp3.3/consist.htm
blob: 40bc374c200aab50cdcf5e4464746c09dc42fb99 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<html>
<head>
<title>
Netlab Reference Manual consist
</title>
</head>
<body>
<H1> consist
</H1>
<h2>
Purpose
</h2>
Check that arguments are consistent.

<p><h2>
Synopsis
</h2>
<PRE>
errstring = consist(net, type, inputs, outputs)
errstring = consist(net, type, inputs)
errstring = consist(net, type)
</PRE>


<p><h2>
Description
</h2>

<p><CODE>errstring = consist(net, type, inputs)</CODE> takes a network
data structure <CODE>net</CODE> together with a string <CODE>type</CODE> containing
the correct network type, a matrix <CODE>inputs</CODE> of input vectors and checks
that the data structure is consistent with the other arguments.  An empty
string is returned if there is no error, otherwise the string contains the
relevant error message.  If the <CODE>type</CODE> string is empty, then any
type of network is allowed.

<p><CODE>errstring = consist(net, type)</CODE> takes a network data structure
<CODE>net</CODE> together with a string <CODE>type</CODE> containing the correct 
network type, and checks that the two types match.

<p><CODE>errstring = consist(net, type, inputs, outputs)</CODE> also checks that the
network has the correct number of outputs, and that the number of patterns
in the <CODE>inputs</CODE> and <CODE>outputs</CODE> is the same.  The fields in <CODE>net</CODE>
that are used are
<PRE>
  type
  nin
  nout
</PRE>


<p><h2>
Example
</h2>

<p><CODE>mlpfwd</CODE>, the function that propagates values forward through an MLP
network, has the following check at the head of the file:
<PRE>

errstring = consist(net, 'mlp', x, t);
if ~isempty(errstring)
  error(errstring)
end
</PRE>


<p><h2>
See Also
</h2>
<CODE><a href="mlpfwd.htm">mlpfwd</a></CODE><hr>
<b>Pages:</b>
<a href="index.htm">Index</a>
<hr>
<p>Copyright (c) Ian T Nabney (1996-9)


</body>
</html>