http://www.mathworks.com/matlabcentral/newsreader/view_thread/322421
MATLAB Central Newsreader  Configure neural network without train
Feed for thread: Configure neural network without train
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Thu, 09 Aug 2012 15:30:22 +0000
Configure neural network without train
http://www.mathworks.com/matlabcentral/newsreader/view_thread/322421#884977
Rafael
Hello,<br>
<br>
I'm treating with dynamic recurrent neural networks, NARX in my case, and my objective is to adjust the parameters with genetic algorithm. Therefore I am not using the 'train' command, but I have to configure the network by hand (either manually or with the 'configure' command) and handle the weights and bias vectors with 'getwb' and 'setwb'. The problem I'm encountering is that I can't set and retrieve the networks parameters because I think the net is not getting correctly configured.<br>
<br>
I'm trying with the net configuration in two ways, the first one manually (assigning input and output sizes and ranges, input preprocessing settings and output postprocessing settings), I do this by typing:<br>
<br>
nn.inputs{1}.exampleInput = nnDataIn;<br>
nn.inputs{2}.exampleInput = nnDataOut;<br>
<br>
(The net has 2 input sources because it's in open loop at the moment)<br>
<br>
And althought I got correct inputs and output sizes, ranges and I can initialize the weights using 'init' with success; I can't get or set them with 'getwb' or 'setwb'. I get this error:<br>
<br>
SWITCH expression must be a scalar or string constant.<br>
<br>
Error in network/subsref (line 140)<br>
switch (subs)<br>
<br>
Error in getwb (line 22)<br>
inputLearn = net.hint.inputLearn;<br>
<br>
I tried to configure the net in another way with the 'configure' command:<br>
<br>
nn = configure(nn, nnDataIn, nnDataOut);<br>
<br>
But I get this error:<br>
<br>
Error using network/configure (line 111)<br>
The numbers of input signals and networks inputs do not match.<br>
<br>
I guess it's because the net has 2 input sources and I'm passing only 1 input signal and the target signal, but I don't know how to use 'configure' in another way.<br>
<br>
When I try with the closedloop version of the net, the story changes a bit only, I can't configure it in such a way that I could handle the parameters vectors with 'getwb' or 'setwb'. But if I use the 'configure' exactly in the same way that with the openloop version, then it doesn't return any error (I guess it's because this net has only 1 input signal and the 'configure' command is executed in a proper way).<br>
<br>
Could you tell me how could I configure correctly the first net? A dynamic recurrent neural network (NARX) in open loop mode that has 2 input sources and 1 output.<br>
<br>
And I wanted to ask you one more thing related to this configuration process: If I configure the net in this way with sample data, will I have problems with the simulation (I won't use 'train') if I use another sample data? I mean with the normalization process and the process settings, or the net reconfigures the ranges each time a simulation is done?<br>
<br>
Thanks you in advance.<br>
<br>
Regards,<br>
Rafael

Fri, 10 Aug 2012 11:56:12 +0000
Re: Configure neural network without train
http://www.mathworks.com/matlabcentral/newsreader/view_thread/322421#885052
Rafael
Any idea please?

Wed, 22 Aug 2012 19:25:08 +0000
Re: Configure neural network without train
http://www.mathworks.com/matlabcentral/newsreader/view_thread/322421#885915
Greg Heath
"Rafael" wrote in message <k00l2e$gt$1@newscl01ah.mathworks.com>...<br>
> Hello,<br>
> <br>
> I'm treating with dynamic recurrent neural networks, NARX in my case, and my objective is to adjust the parameters with genetic algorithm. Therefore I am not using the 'train' command, but I have to configure the network by hand (either manually or with the 'configure' command) and handle the weights and bias vectors with 'getwb' >and 'setwb'. <br>
<br>
You don't have to use those functions. Access them directly. For examples search<br>
<br>
heath net.IW net.LW net.b<br>
<br>
Hope this helps.<br>
<br>
Greg

Tue, 08 Jan 2013 08:18:16 +0000
Re: Configure neural network without train
http://www.mathworks.com/matlabcentral/newsreader/view_thread/322421#895072
Greg Heath
"Rafael" wrote in message <k00l2e$gt$1@newscl01ah.mathworks.com>...<br>
> Hello,<br>
> <br>
> I'm treating with dynamic recurrent neural networks, NARX in my case, and my objective is to adjust the parameters with genetic algorithm. Therefore I am not using the 'train' command, but I have to configure the network by hand (either manually or with the 'configure' command) and handle the weights and bias vectors with 'getwb' and 'setwb'. The problem I'm encountering is that I can't set and retrieve the networks parameters because I think the net is not getting correctly configured.<br>
> <br>
> I'm trying with the net configuration in two ways, the first one manually (assigning input and output sizes and ranges, input preprocessing settings and output postprocessing settings), I do this by typing:<br>
> <br>
> nn.inputs{1}.exampleInput = nnDataIn;<br>
> nn.inputs{2}.exampleInput = nnDataOut;<br>
> <br>
> (The net has 2 input sources because it's in open loop at the moment)<br>
<br>
Doesn't the output have to be delayed?<br>
<br>
> And althought I got correct inputs and output sizes, ranges and I can initialize the weights using 'init' with success; I can't get or set them with 'getwb' or 'setwb'. <br>
<br>
In an earlier post I suggested using the direct commands<br>
<br>
IW = net.IW<br>
LW = net.LW<br>
b = net.b<br>
<br>
instead of getwb and vice versa instead of setwb.<br>
<br>
> I tried to configure the net in another way with the 'configure' command:<br>
> <br>
> nn = configure(nn, nnDataIn, nnDataOut);<br>
> <br>
> But I get this error:<br>
> <br>
> Error using network/configure (line 111)<br>
> The numbers of input signals and networks inputs do not match.<br>
> <br>
> I guess it's because the net has 2 input sources and I'm passing only 1 input signal and the target signal, but I don't know how to use 'configure' in another way.<br>
<br>
Use a delayed version of the output to add another input. <br>
<br>
> When I try with the closedloop version of the net, the story changes a bit only, I can't configure it in such a way that I could handle the parameters vectors with 'getwb' or 'setwb'. But if I use the 'configure' exactly in the same way that with the openloop version, then it doesn't return any error (I guess it's because this net has only 1 input signal and the 'configure' command is executed in a proper way).<br>
> <br>
> Could you tell me how could I configure correctly the first net? A dynamic recurrent neural network (NARX) in open loop mode that has 2 input sources and 1 output.<br>
<br>
See above.<br>
<br>
> And I wanted to ask you one more thing related to this configuration process: If I configure the net in this way with sample data, will I have problems with the simulation (I won't use 'train') if I use another sample data? I mean with the normalization process and the process settings, or the net reconfigures the ranges each time a simulation is done?<br>
<br>
The summary statistics of the other sample data must be reasonably close. The normalization is done automatically.<br>
<br>
Hope this helps.<br>
<br>
Greg

Thu, 14 Feb 2013 09:05:08 +0000
Re: Configure neural network without train
http://www.mathworks.com/matlabcentral/newsreader/view_thread/322421#897904
Greg Heath
"Rafael" wrote in message <k00l2e$gt$1@newscl01ah.mathworks.com>...<br>
> Hello,<br>
> <br>
> I'm treating with dynamic recurrent neural networks, NARX in my case, and my objective is to adjust the parameters with genetic algorithm. Therefore I am not using the 'train' command, but I have to configure the network by hand (either manually or with the 'configure' command) and handle the weights and bias vectors with 'getwb' and 'setwb'. The problem I'm encountering is that I can't set and retrieve the networks parameters >because I think the net is not getting correctly configured.<br>
<br>
Use preparets before configure.<br>
<br>
Hope this helps.<br>
<br>
Greg<br>