Main Page | Report this Page
Computers Forum Index  »  Computer Artificial Intelligence - Neural Nets  »  Normalizing NN complex data input...
Page 2 of 2    Goto page Previous  1, 2

Normalizing NN complex data input...

Author Message
Greg...
Posted: Sun Sep 06, 2009 11:07 pm
Guest
On Aug 29, 11:42 am, panosso <pano... at (no spam) gmail.com> wrote:
Quote:
On 13 ago, 05:24, George Campbel <gcampbel2... at (no spam) gmail.com> wrote:





On Aug 13, 9:57 am, Greg <he... at (no spam) alumni.brown.edu> wrote:

On Aug 12, 5:50 am, George Campbel <gcampbel2... at (no spam) gmail.com> wrote:

On Aug 12, 2:32 am, Greg <he... at (no spam) alumni.brown.edu> wrote:

On Aug 8, 11:00 pm, George Campbel <gcampbel2... at (no spam) gmail.com> wrote:

On Aug 6, 8:50 am, Greg <he... at (no spam) alumni.brown.edu> wrote:

On Jul 25, 8:00 am, George Campbel <gcampbel2... at (no spam) gmail.com> wrote:

On Jul 24, 5:45 pm, Greg <he... at (no spam) alumni.brown.edu> wrote:

On Jul 24, 5:09 am, George Campbel <gcampbel2... at (no spam) gmail.com> wrote:

On Jul 24, 4:35 pm, Greg <he... at (no spam) alumni.brown.edu> wrote:

On Jul 23, 11:23 pm, George Campbel <gcampbel2... at (no spam) gmail.com> wrote:

On Jul 11, 7:24 pm, Greg <he... at (no spam) alumni.brown.edu> wrote:
On Jul 10, 10:47 pm, George Campbel <gcampbel2... at (no spam) gmail.com> wrote:

I am working on complex number and think of normalizing the input XOR
number before applying to the neural network.

-----SNIP
But for a complex number, how do i solve the data normalization
because it contains real and imaginary part.

z = x + j*y;
zn = (z-mean(z))./std(z);

Hope this helps.

Greg

HiProf,

I observed that this doesnt work well for some data, e.g

x=[-.3-.4i,-.3-.456i,-.283-.387i]

x
  -0.3000 - 0.4000i  -0.3000 - 0.4560i  -0.2830 - 0.3870i

y=(x-mean(x))./(var(x))

INCORRECT. SEE ABOVE

sumclockmin = 2009+1+1+0+0+0

sumclockmax = 2009+12+31+23+59+59
sumclocknow = sum(clock)

state0 = (2^31-1)*(sumclocknow-sumclockmin)/(sumclockmax-sumclockmin)
rand('state',state0 )
randn('state',state0 )

N = 3  % observations
I = 2  % inputs

z = rand(2,3) + randn(2,3)

meanz = repmat(mean(z')',1,N)
varz = repmat(var(z')',1,N)
stdz = repmat(std(z')',1,N)
err = stdz - sqrt(varz)
zn  = (z-meanz)./(stdz)

sumclockmin > > > > > > > > > > >         2011
sumclockmax > > > > > > > > > > >         2193
sumclocknow > > > > > > > > > > >   2.0650e+003
state0 > > > > > > > > > > >   6.3771e+008
N > > > > > > > > > > >      3
I > > > > > > > > > > >      2
z > > > > > > > > > > >    -0.6328   -0.0428    3.0043
    0.6878   -2.3708    0.2313
meanz > > > > > > > > > > >     0.7763    0.7763    0.7763
   -0.4839   -0.4839   -0.4839
varz > > > > > > > > > > >     3.8102    3.8102    3.8102
    2.7223    2.7223    2.7223
stdz > > > > > > > > > > >     1.9520    1.9520    1.9520
    1.6499    1.6499    1.6499
err > > > > > > > > > > >      0     0     0
     0     0     0
zn > > > > > > > > > > >    -0.7218   -0.4196    1.1414
    0.7101   -1.1436    0.4335

Hope this helps.

Greg

Hi prof Greg,

I think what i simply want to do is to normalize the input data vector
x using the method of
Newx = (x-mean(x))./std(x);

Do i need to initialize the random data ?

As worded, the question doesn't make sense.
Did you mean

Q: Do i need to initialize the random number generators?
A: No. However it makes life easy if you want to
repeat a learning run with weights that were randomly initialized.

Hope this helps.

Greg

P.S. I chose random data just to come up with an example.

Prof,

Thanks for the last response.

But what will happen if i want to normalized data x below ahead of
using it as neural network  input ?

x=[-.3-.4i,-.3-.456i,-.283-.387i]

I don't understand the question.

Greg

What i am trying to do is that, I have an input data x, (x in this
case is not a random number) ,
I want to normalized this data using
newx=(x-mean(x))./(var(x)) .

BZZZT!

Use the corrected formula.

So newx is now the input to the complex valued network. I observed
that the value i have for newx  is  larger than the values i
originally fed to the normalization equation and this results in large
error during training.

The scaling of your input should have little to do with the size of
your
error, Training should scale weights accordingly.

How best can i normalized my input data prior to feeding it to neural
network ?

Use the correct formula. If the data is not training data, you
have to use the mean and std obtained from training.

Hope this helps.

Greg

Hope this is the corrected formula ?

z = x + j*y;
zn = (z-mean(z))./std(z);- Hide quoted text -

Yes. For vectors,

meanz = mean(ztrn);
stdz     = std(ztrn);

ztrnn = (ztrn-meanz)./stdz;
zvaln = (zval-meanz)./stdz;
ztatn = (ztst-meanz)./stdz;

For matrices, use repmat to create conforming
dimensions for meanz and stdz.

Hope this helps.

Greg- Hide quoted text -

- Show quoted text -

Prof,

Hope this is ok now ?

ztrn= [-.3-.4i,-.3-.456i,-.283-.387i]

meanz = mean(ztrn);
stdz     = std(ztrn);
ztrnn = (ztrn-meanz)./stdz

ztrn
  -0.3000 - 0.4000i  -0.3000 - 0.4560i  -0.2830 - 0.3870i

ztrnn
  -0.1493 + 0.3776i  -0.1493 - 1.0978i   0.2986 + 0.7201i

what does zvaln = (zval-meanz)./stdz;
ztatn = (ztst-meanz)./stdz;
stad for.

Campbel

Sorry ..  .
. .. but am I right or you both are using the wrong concept ?

firs of all, are you usig MATLAB, because if YES, you may use the ABS
function to get the SIZE_OF_THE_VECTOR instead of MEAN . . .so thet,
for your example x, we may have :

x=[-.3-.4i,-.3-.456i,-.283-.387i]

x
  -0.3000 - 0.4000i  -0.3000 - 0.4560i  -0.2830 - 0.3870i

and then, after the following simple loop

for i=[1:3]
        x(i) = (x(i))/(abs(x(i));
end

we will get :

x

x
  -0.6000 - 0.8000i  -0.5496 - 0.8354i  -0.5903 - 0.8072i

were all of the vectors on x array has 1 as the
SIZE_OS_THE_VECTOR . . .

The typical normalization for MLPs is standardization:

zero mean and zero variance.

Other normalizations may be more useful for other types
of NNs, For example Kohonen's SOFM is sometimes used
with unit vector inputs such as you have suggested.

Hope this helps.

Greg
 
 
Page 2 of 2    Goto page Previous  1, 2
All times are GMT
The time now is Tue Dec 01, 2009 7:52 pm