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.
Bu kısım daha ileri hazır fonksiyonları içerir.
NEURAL NETWORKS SIMPLIFIED - 2
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.
This section includes more advanced built-in functions.
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 UTILITY FUNCTIONS
*******************************************************
octave:2> a=[1,2,3;4,5,6]
a =
1 2 3
4 5 6
octave:3> log(a)
ans =
0.00000 0.69315 1.09861
1.38629 1.60944 1.79176
octave:4> a=[-1,-2,3;4,-5,-6]
a =
-1 -2 3
4 -5 -6
octave:5> abs(a)
ans =
1 2 3
4 5 6
octave:6> exp(a)
ans =
3.6788e-001 1.3534e-001 2.0086e+001
5.4598e+001 6.7379e-003 2.4788e-003
octave:7> sum(a)
ans =
3 -7 -3
octave:8> a
a =
-1 -2 3
4 -5 -6
octave:9> sumsq(a)
ans =
17 29 45
octave:10> a=[4,9]
a =
4 9
octave:11> sqrt(a)
ans =
2 3
octave:12> mod(a,2)
ans =
0 1
octave:13> mod(3,2)
ans = 1
octave:14> floor ([-2.7, 2.7])
ans =
-3 2
octave:15> floor(3.4)
ans = 3
octave:16> ceil(3.4)
ans = 4
octave:17> ceil([-2.7,2.7])
ans =
-2 3
octave:18> realmax()
ans = 1.7977e+308
octave:19> a=[1,2,3;4,5,6;7,8,9]
a =
1 2 3
4 5 6
7 8 9
octave:20> bsxfun(@minus, a,2)
ans =
-1 0 1
2 3 4
5 6 7
octave:21> a=[3,1,5;3,4,2;7,3,5]
a =
3 1 5
3 4 2
7 3 5
octave:22> sort(a)
ans =
3 1 2
3 3 5
7 4 5
octave:23> a
a =
3 1 5
3 4 2
7 3 5
octave:24> sort ([1, 2; 2, 3; 3, 1])
ans =
1 1
2 2
3 3
octave:25> [s, i] = sort ([1, 2; 2, 3; 3, 1])
s =
1 1
2 2
3 3
i =
1 3
2 1
3 2
octave:26> [s, i] = sort ([1, 2; 2, 3; 3, 1], 'descend');
octave:27> s
s =
3 3
2 2
1 1
octave:28> i
i =
3 2
2 1
1 3
octave:29> a
a =
3 1 5
3 4 2
7 3 5
octave:30> mean(a)
ans =
4.3333 2.6667 4.0000
octave:31> find(a==2)
ans = 8
octave:32> a(8)
ans = 2
octave:33> a=[1,1;1,1]
a =
1 1
1 1
octave:34> inv(a)
warning: inverse: matrix singular to machine precision, rcond = 0
ans =
Inf Inf
Inf Inf
octave:35> pinv(a)
ans =
0.25000 0.25000
0.25000 0.25000
octave:36> a=[1,2,3;4,5,6]
a =
1 2 3
4 5 6
octave:37> pinv(a)
ans =
-0.94444 0.44444
-0.11111 0.11111
0.72222 -0.22222
octave:38> a=[1,2,3;4,5,6;7,8,9]
a =
1 2 3
4 5 6
7 8 9
octave:39> X=[ones(3,1) a]
X =
1 1 2 3
1 4 5 6
1 7 8 9
octave:40> b=[1;2;3]
b =
1
2
3
octave:41> a(2,:) = b
a =
1 2 3
1 2 3
7 8 9
octave:42> a
a =
1 2 3
1 2 3
7 8 9
octave:43> a(2,:) = b'
a =
1 2 3
1 2 3
7 8 9
octave:44> Y=[a(:) ; b(:)]
Y =
1
1
7
2
2
8
3
3
9
1
2
3
octave:45> find(a>3)
ans =
3
6
9
octave:46> a
a =
1 2 3
1 2 3
7 8 9
octave:47> ndx=find(a>3)
ndx =
3
6
9
octave:48> for i=1:length(ndx)
> a(ndx(i)) = 1;
> end
octave:49> a
a =
1 2 3
1 2 3
1 1 1
octave:50>
octave:50> a=[1.2,3.4,5.0]
a =
1.2000 3.4000 5.0000
octave:51> round(a)
ans =
1 3 5
octave:52> randperm(3,4)
ans =
2 3 1
1 2 3
1 3 2
2 1 3
octave:53> randperm(3)
ans =
2 1 3
octave:54> a=cell(2,4)
a =
{
[1,1] = [](0x0)
[2,1] = [](0x0)
[1,2] = [](0x0)
[2,2] = [](0x0)
[1,3] = [](0x0)
[2,3] = [](0x0)
[1,4] = [](0x0)
[2,4] = [](0x0)
}
octave:55> a(1,1)=5
a =
{
[1,1] = 5
[2,1] = [](0x0)
[1,2] = [](0x0)
[2,2] = [](0x0)
[1,3] = [](0x0)
[2,3] = [](0x0)
[1,4] = [](0x0)
[2,4] = [](0x0)
}
octave:59> a=["a","b"]
a = ab
octave:60> a(1,1)
ans = a
octave:61> a(1,2)
ans = b
octave:62> a
a = ab
octave:63> a=cell(2)
a =
{
[1,1] = [](0x0)
[2,1] = [](0x0)
[1,2] = [](0x0)
[2,2] = [](0x0)
}
octave:64> a(1,1)="a"
a =
{
[1,1] = a
[2,1] = [](0x0)
[1,2] = [](0x0)
[2,2] = [](0x0)
}
octave:65> a(2,1)="b"
a =
{
[1,1] = a
[2,1] = b
[1,2] = [](0x0)
[2,2] = [](0x0)
}
diary off