From: Jorge Amaral on
Hi,

I want to train a neural network with Bayesian regularization ( trainbr) and I have a few questions

1)
I look at the matlab's example.

p = [-1:.05:1];
t = sin(2*pi*p)+0.1*randn(size(p));
net=newff(minmax(p),[20,1],{'tansig','purelin'},'trainbr');

when you type this, the performance function is mse. however when I type the rest of the example:

randn('seed',192736547);
net = init(net);
[net,tr]=train(net,p,t);

The performance function became SSE! Why did it change?
Why the init(net) is done explicitly? Wouldn´t the train procedure do that anyway?

2) How is done the choice of parameters when you use Bayesian regularization? I mean how do I choose the number of epochs and the number of neurons in the hidden layer.

Thanks,
Jorge
From: Greg Heath on
On Jun 2, 1:24 pm, "Jorge Amaral"
<jorge.luis.machado.ama...(a)gmail.com> wrote:
> Hi,
>
>    I want to train aneural network with Bayesian regularization ( trainbr) and I have a few questions
>
> 1)
> I look at the matlab's example.
>
> p = [-1:.05:1];
> t = sin(2*pi*p)+0.1*randn(size(p));
> net=newff(minmax(p),[20,1],{'tansig','purelin'},'trainbr');
>
> when you type this, the performance function is mse

No, it is not.

doc trainbr
help trainbr

.. however when I type the rest of the example:
>
>  randn('seed',192736547);
> net = init(net);

delete this. NEWFF automatically initializes weights.

> [net,tr]=train(net,p,t);
>
> The performance function became SSE! Why did it change?

No change. See above

> Why the init(net) is done explicitly? Wouldn´t the  train procedure do that anyway?

Correct.

> 2) How is done the choice of parameters when you use Bayesian regularization? I
> mean how do I choose the number of epochs and the number of neurons in the
> hidden layer.

Use the default number of epochs. If that is insufficient,
either repeat the training command with the trained net
or start over with the same RAND seed but maxepochs
increased.

Hope this helps.

Greg