Category : Miscellaneous Language Source Code
Archive   : NEURAL.ZIP
Filename : ASYNCH.C

 
Output of file : ASYNCH.C contained in archive : NEURAL.ZIP
/*
ASYNCH ASYNCHRONOUSLY UPDATES THE BAM

COPYRIGHT (C) 1987, JOEL S. DAVIS. AFTER BYTE PUBLICATION, APPROVED FOR
NON-COMMERCIAL USE ONLY
*/
#include "STRUCT.H"
#include "EXT.H"
asynch(axn,ayn,bxn,byn,an,bn,n_asyn)
int *axn,*ayn,*bxn,*byn,*an,*bn,n_asyn;
{
int i,j,k,l,m,n,index,iter,sum;
int seed;
char buf[9];
double x,frand();

/* GET A RANDOM NUMBER SEED FROM THE SYSTEM CLOCK */
/* READ THE CLOCK */
times(buf);

/* GENERATE THE SEED INTEGER */
seed = (int) (buf[7] - '0');
seed += seed + 10 * ((int) ((buf[6] - '0')));
seed += seed + 60 * ((int) ((buf[4] - '0')));
seed += seed + 600 * ((int) ((buf[3] - '0')));
srand(seed);

/* GO THROUGH TEN ITERATIONS */
iter = 10;
for(k=0;k /* UPDATE N_ASYN NEURONS */
for(n=0;n sum = 0;
/* PROCESS B VECTOR NEURON */
/* WHICH NEURON DO I UPDATE THIS TIME ? */
x = (double) *bn;
x *= frand();
x += 0.5;
j = (int) x;

/* APPLY ALL A VECTOR INPUTS */
for(i=0;i<*an;i++){
sum += a[i] * xty[i][j];
}

/* NOW DO THRESHOLDING */
if(sum>0){
b[j] = 1;
}else if(sum<0){
b[j] = 0;
}else{
/* RETAIN VALUE */
continue;
}
}

vec_show(axn,ayn,bxn,byn);

/* NOW IN REVERSE TO PROCESS A VECTOR NEURONS */
/* UPDATE N_ASYN NEURONS */
for(n=0;n sum = 0;
/* PROCESS B VECTOR NEURON */
/* WHICH NEURON DO I UPDATE THIS TIME ? */
x = (double) *an;
x *= frand();
x += 0.5;
i = (int) x;

/* FOR EACH A VECTOR NEURON, APPLY ALL B VECTOR INPUTS */
for(j=0;j<*bn;j++){
sum += b[j] * xty[i][j];
}
/* NOW DO THRESHOLDING */
if(sum>0){
a[i] = 1;
}else if(sum<0){
a[i] = 0;
}else{
/* RETAIN VALUE */
continue;
}
}

vec_show(axn,ayn,bxn,byn);
}
}


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : NEURAL.ZIP
Filename : ASYNCH.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/