3
a
:
: 3751
:
: 2
: .
: _____________2015 .
2015
:
1. . .
2. Matlab,C#
3. ( 1 2, )
. . .
, .
1
, Wij i- , :
, (1)
, yi = ui.
, . , :
, (2)
x :
, (3)
η. η =l wij j . x .
η <l wij x.
, . .
2 a
a . , , , .
. Wij, .
a :
Wij (t+1) =Wij (t) +η*Yi*(Yi-Wij(t)),
yi i- , .
. , .
1 koeff= 0.5+0.01*2=0.52 iteration= 200+2=202
X | W=W+0.006 *2 | Y |
0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 | 0.312 0.212 0.312 0.612 0.512 0.312 0.312 0.412 0.112 0.212 0.612 0.312 0.412 0.312 0.112 0.512 |
|
|
2 koeff= 0.8+0.01*2=0.82 iteration= 1000+4=1002
X | W=W+0.008*2 | Y |
0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 | 0.316 0.216 0.316 0.616 0.516 0.316 0.316 0.416 0.116 0.216 0.616 0.316 0.416 0.316 0.116 0.516 |
Matlab
X=[0 0 1 0; 0 0 1 0; 0 1 0 0; 0 1 0 1; 1 0 0 0; 1 0 0 1; 1 0 1 0;1 0 1 1; 1 1 0 0; 1 1 0 1] %
weight =[0.316 0.216 0.316 0.616; 0.516 0.316 0.316 0.416; 0.116 0.216 0.616 0.316; 0.416 0.316 0.116 0.516] %
koeff= 0.82 % 0 1
itteration=1002 %
for t=1:itteration
fori=1:10
forj=1:4
w(j)=X(i,:)* weight (j,:)' % ,
end
[vc]=max(w) %
% '
%
weight (c,:)= weight (c,:)+koeff*(X(i,:)- weight (c,:))
%
% weight (c,:)= weight (c,:)+koeff*(Y(i,:)- weight (c,:))
% c
% weight (c,:)= weight (c,:)+koeff*Y*(Y(i,:)- weight (c,:))
%display(weight)%
% 0 1 (3)
k=power(weight (c,:), 2); %
f=sqrt(sum(k)); %
weight (c,:)= weight (c,:)/f;
end
end
display(weight)
#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace InstarGrossbera
{
class Program
{
static void Main(string[] args)
{
double[,] X = new double[10, 4] { {0, 0, 1, 0}, //,
{0, 0, 1, 1},
{0, 1, 0, 0},
{0, 1, 0, 1},
{1, 0, 0, 0},
{1, 0, 0, 1},
{1, 0, 1, 0},
{1, 0, 1, 1},
{1, 1, 0, 0},
{1, 1, 0, 1}};
double[,] W = new double[4, 4] { {0.312, 0.212, 0.312, 0.612},
{0.512, 0.312, 0.312, 0.412},
{0.112, 0.212, 0.612, 0.312},
{0.412, 0.312, 0.112, 0.512}};
double koeff = 0.5+0.01*2;
double[] w = new double[4];
for (int k = 0; k < 202; k++)
{
for (int i = 0; i< 10; i++)
{
for (int j = 0; j < 4; j++)
{
w[j] = allRowValue(X, W, i, j);
}
int index = GetIndexMaxElement(w, w.Max());
redefinitionW(W, X, index, i, koeff);
}
}
Console.WriteLine("Weight = {");
for (int i = 0; i< 4; i++)
{
for (int j = 0; j < 4; j++)
{
Console.Write("\t" + Math.Round(W[i, j], 3, MidpointRounding.ToEven).ToString());
}
Console.Write("\n");
}
Console.WriteLine("\t}");
Console.ReadKey();
}
static double allRowValue(double[,] matrixA, double[,] matrixB,
int numberRowA, int numberRowB)
{
double a = 0;
for (int i = 0; i< 4; i++)
{
a += matrixA[numberRowA, i] * matrixB[numberRowB, i];
}
return a;
}
static int GetIndexMaxElement(double[] array, double maxElement)
|
|
{
for (int i = 0; i<array.Length; i++)
{
if (array[i] == maxElement)
return i;
}
return 0;
}
static void redefinitionW(double[,] W, double[,] X, int indexRow,
int indexRowX, double koeff)
{
double a = 0;
for (int i = 0; i< 4; i++)
{
W[indexRow, i] = W[indexRow, i] + koeff * (X[indexRowX, i] - W[indexRow, i]);
a += Math.Pow(W[indexRow, i], 2);
}
a = Math.Sqrt(a);
for (int i = 0; i< 4; i++)
{
W[indexRow, i] = W[indexRow, i] / a;
}
}
}
}
1 η =0.52 iteration=202
2 - η =0.82 iteration=1002
. η. η =l wij j . x . η <l wij x.
1. ., ., . , : . , .. . .: -, 2013. 384 .
2. . : .- .: , 2003. 864 .
3. . / . . .: , 2002. 342.
4. . . . . . . . .: , 2001. 221 .
5. . . .: , 1992. 240 c.