BASİTLEŞTİRİLMİŞ YAPAY SİNİR AĞLARI - 1
Bu eğitim metni Hinton'un iki kursunda kullanılan yapılar
için yapılmış basit örneklere dayanır. Bu kurslar sırasında
verilen örnekler internet üzerinde yaygın şekilde bulunabilir.
NEURAL NETWORKS SIMPLIFIED - 1
This is a tutorial based on simple examples made for the
structures used in Hinton's two courses. The exercises
given during these courses are widely available on the internet.
Herhangi bir soru varsa beni aramakta tereddüt etmeyiniz.
Please do not hesitate to contact me if any questions.
Ali R+ SARAL
arsaral((at))yaho(o).com
MATRIX DEFINITIONS
***************************************
a is a 2 x 3 matrix. a has 2 rows and 3 columns.
a 2 x 3 bir matristir. a'nın iki satırı ve 3 sütunu vardır.
octave:65> a=[1,2,3;4,5,6]
a =
1 2 3
4 5 6
octave:66> size(a)
ans =
2 3
An other matrix definition statement is: a(beg : end)
Bir başka matris tanımlama komutu: a(baş : son)
octave:73> a=(-1:3)
a =
-1 0 1 2 3
An other matrix definition statement is: a(beg :increment : end)
Bir başka matris tanımlama komutu: a(baş : arttırım adımı : son)
octave:75> a=(-1:0.5:2)
a =
-1.0000 -0.5000 0.0000 0.5000 1.0000 1.5000 2.0000
An other matrix definition statement is: linspace(beg : step count : end)
Bir başka matris tanımlama komutu: linspace(baş : adım sayısı : son)
octave:77> a=linspace(1,0.5,3)
a =
1.00000 0.75000 0.50000
octave:78> a=linspace(1,3,3)
a =
1 2 3
octave:79> a=linspace(1,3,4)
a =
1.0000 1.6667 2.3333 3.0000
MATRIX ELEMENT ADDRESSING
MATRİS ELEMAN ADRESLEME
***************************************
octave:84> a=[1,2,3;4,5,6]
a =
1 2 3
4 5 6
octave:85> a(1)
ans = 1
octave:86> a(1:4)
ans =
1 4 2 5
octave:87> a(1:6)
ans =
1 4 2 5 3 6
octave:88> a(1:2,1)
ans =
1
4
octave:89> a(1:2,3)
ans =
3
6
octave:90> a(1:2,[1 3])
ans =
1 3
4 6
octave:91> a(1:2,1:3)
ans =
1 2 3
4 5 6
octave:92> a(1:2,:)
ans =
1 2 3
4 5 6
octave:93> a(:,1:2)
ans =
1 2
4 5
octave:94> a(1,1:3)
ans =
1 2 3
octave:95> a(:,:)
ans =
1 2 3
4 5 6
octave:104> a=[1,2,3;4,5,6;7,8,9]
a =
1 2 3
4 5 6
7 8 9
octave:106> b=[1,2]
b =
1 2
octave:107> a(b,:)
ans =
1 2 3
4 5 6
octave:108> a(1,:)
ans =
1 2 3
BASIC MATRIX FUNCTIONS
***************************************
octave:2> ndims([1,2;3,4])
ans = 2
octave:10> ones(2,3)
ans =
1 1 1
1 1 1
octave:11> zeros(1,2)
ans =
0 0
octave:12> eye(1,3)
ans =
Diagonal Matrix
1 0 0
octave:13> eye(3)
ans =
Diagonal Matrix
1 0 0
0 1 0
0 0 1
octave:14> a = 13; a(ones (1, 4))
ans =
13 13 13 13
octave:17> rand(3)
ans =
0.61503 0.73559 0.16378
0.11622 0.89969 0.96928
0.16057 0.14347 0.84992
octave:14> a = 13;
octave:18> size(a)
ans =
1 1
octave:19> a=[1,2;3,4;5,6]
a =
1 2
3 4
5 6
octave:20> size(a)
ans =
3 2
octave:21> b=1
b = 1
octave:22> size(b)
ans =
1 1
octave:2> zeros(1)
ans = 0
octave:3> zeros(2,2)
ans =
0 0
0 0
octave:4> zeros(2,3)
ans =
0 0 0
0 0 0
octave:5> a=[1,2;3,4;5,6]
a =
1 2
3 4
5 6
octave:6> zeros(size(a))
ans =
0 0
0 0
0 0
octave:7> size(a)
ans =
3 2
octave:8> eye(0)
ans = [](0x0)
octave:9> eye(1)
ans = 1
octave:10> eye(2)
ans =
Diagonal Matrix
1 0
0 1
octave:11> eye(2,3)
ans =
Diagonal Matrix
1 0 0
0 1 0
octave:12> ones(0)
ans = [](0x0)
octave:13> ones(1)
ans = 1
octave:14> ones(2)
ans =
1 1
1 1
octave:15> ones(2,3)
ans =
1 1 1
1 1 1
octave:16> rand(0)
ans = [](0x0)
octave:17> rand(1)
ans = 0.76538
octave:18> rand(1)
ans = 0.74158
octave:19> rand(2)
ans =
0.62458 0.30045
0.48308 0.36512
octave:62> rand(2)
ans =
0.148336 0.481660
0.082268 0.182176
octave:20> rand(2,3)
ans =
0.056270 0.180314 0.794059
0.905070 0.366595 0.562126
octave:21> a=[1,2;3,4]
a =
1 2
3 4
octave:22> size(a)
ans =
2 2
octave:23> b=[1,2,3;4,5,6]
b =
1 2 3
4 5 6
octave:24> size(b)
ans =
2 3
octave:25> length(b)
ans = 3
octave:26> length(a)
ans = 2
octave:27> c=[1,2,3,4,5]
c =
1 2 3 4 5
octave:28> length(c)
ans = 5
octave:29> max(c)
ans = 5
octave:30> max(b)
ans =
4 5 6
octave:31> max(a)
ans =
3 4
octave:32> min(c)
ans = 1
octave:33> min(b)
ans =
1 2 3
octave:34> min(a)
ans =
1 2
octave:35> d=[2,3,1,5,6,4]
d =
2 3 1 5 6 4
octave:36> min(d)
ans = 1
octave:37> max(d)
ans = 6
octave:38> d=[2,3,1,5,6,4;1,2,3,4,5,6]
d =
2 3 1 5 6 4
1 2 3 4 5 6
octave:39> min(d)
ans =
1 2 1 4 5 4
octave:40> max(d)
ans =
2 3 3 5 6 6
octave:41> numel(d)
ans = 12
octave:42> numel(c)
ans = 5
octave:43> numel(b)
ans = 6
octave:44> numel(a)
ans = 4
norm (A, p, opt)
Compute the p-norm of the matrix A.
If the second argument is missing, p = 2 is assumed.
If A is a matrix (or sparse matrix):
p = 1 1-norm, the largest column sum of the absolute values of A.
p = 2 Largest singular value of A.
octave:45> norm(a)
ans = 5.4650 <===========
octave:46> a
a =
1 2
3 4
octave:49> [U,S,V]=svd(a)
Compute the singular value decomposition of A
A'nın tekil değer ayrıştırımını hesaplayınız.
U =
-0.40455 -0.91451
-0.91451 0.40455
S =
Diagonal Matrix
5.46499 0 <===========
0 0.36597
V =
-0.57605 0.81742
-0.81742 -0.57605
octave:50> b
b =
1 2 3
4 5 6
octave:51> [U,S,V]=svd(b)
U =
-0.38632 -0.92237
-0.92237 0.38632
S =
Diagonal Matrix
9.50803 0 0 <===========
0 0.77287 0
V =
-0.42867 0.80596 0.40825
-0.56631 0.11238 -0.81650
-0.70395 -0.58120 0.40825
octave:52> norm(b)
ans = 9.5080 <===========
octave:53> c
c =
1 2 3 4 5
octave:54> [U,S,V]=svd(c)
U = 1
S =
Diagonal Matrix
7.4162 0 0 0 0 <===========
V =
0.134840 -0.269680 -0.404520 -0.539360 -0.674200
0.269680 0.935914 -0.096129 -0.128172 -0.160215
0.404520 -0.096129 0.855807 -0.192258 -0.240322
0.539360 -0.128172 -0.192258 0.743656 -0.320430
0.674200 -0.160215 -0.240322 -0.320430 0.599463
octave:55> norm(c)
ans = 7.4162 <===========