November 23rd, 2010

[code] : Dynamic Perceptron

Perceptron merupakan cabang Artificial Neural Network… Boleh dikatakan sebagai cabang paling simple di dalam neural network… Apa yg sedang sy cuba bangun kan adalah engine untuk Dynamic Perceptron… Untuk post kali ini sy menunjukkan cara sy membuat dynamic input didalam perceptron…

//A1
System.out.print("Enter number of Input");
int noInput = Integer.parseInt(input.readLine());

//A2
int noRow = (int)java.lang.Math.pow(2, noInput);
int divide = noRow;

//A3
int matrix[][] = new int[noRow][noInput];

//A4this part is to count the number of binary row
for(int inputs=0; inputs<noInput;inputs++) {
divide = divide/2;
for (int row=0;row<noRow;row++) {
//both if statement below is to consider if the matrix is 1 or 0
if (counter<=divide) { matrix[row][inputs]=binary;counter++; }
if(counter>divide) { counter=1; if(binary==1) binary=0; else binary=1;}
}}

A1 => Arahan untuk input
A2 => Row perlu ditentukan untuk memudahkan pengiraan matrix
A3 => Declare matrix array
A4 & A5 => Perhatikan betul2 pada for loop… Sila trace untuk lebih faham…

Matrix akan menyelesaikan mengikut number input…

contoh untuk input = 3

x1 = 1,1,1,1,0,00,0
x2 = 1,1,0,0,1,1,0,0
x3 = 1,0,1,0,1,0,1,0

Program ini merupakan asas kepada neural network… Jadi ia tidak terbaas kepada Perceptron sahaja…. Sebarang idea dan pertanyaan boleh lah diajukan…

Sekian….

ANTARA YANG MENARIK



[code] : Tower Of Hanoi


[code] : WordPress Cheat List


Download Tutorial #01 : Learn Ruby The Hard Way


[info] : WordPress 3.1 is ready for download
.

Apa pendapat anda?

Follow BEYTA.net di Twitter


17 queries. 0.353 seconds.
© 2011 BEYTA.network | Coders Republic - Certified by Microsoft as Profesional Developer
Beyta | Tajuzzaman bin Tajol Molok. MCPD. MCTS.