petersj@ces.clemson.edu
albert% cd cmacclass_ftp /home/peterson/programs/cmacclass_ftp albert% ls Xheaders/ cmacclass/ usecmac/ utility/ albert%This code then tarred as follows:
tar cvf - cmacclass_ftp > cmacclass_ftp.tar a cmacclass_ftp/ 0K a cmacclass_ftp/cmacclass/ 0K a cmacclass_ftp/cmacclass/cmaceval.c 2K a cmacclass_ftp/cmacclass/MakeLibrary 3K a cmacclass_ftp/cmacclass/echo.c 4K a cmacclass_ftp/cmacclass/cmac.h 12K a cmacclass_ftp/cmacclass/func2.c 7K a cmacclass_ftp/cmacclass/equal.c 2K a cmacclass_ftp/cmacclass/config.c 4K a cmacclass_ftp/cmacclass/default_constructor.c 4K a cmacclass_ftp/cmacclass/func.c 7K a cmacclass_ftp/cmacclass/getcmac.c 4K a cmacclass_ftp/cmacclass/cmacinit.c 5K a cmacclass_ftp/cmacclass/number.c 3K a cmacclass_ftp/cmacclass/getrms.c 1K a cmacclass_ftp/cmacclass/copy_constructor.c 2K a cmacclass_ftp/cmacclass/readte.c 2K a cmacclass_ftp/cmacclass/readtr.c 2K a cmacclass_ftp/cmacclass/readw.c 1K a cmacclass_ftp/cmacclass/constructor.c 1K a cmacclass_ftp/cmacclass/gettrainsize.c 1K a cmacclass_ftp/cmacclass/gettestsize.c 1K a cmacclass_ftp/cmacclass/virtmem.c 9K a cmacclass_ftp/cmacclass/writew.c 2K a cmacclass_ftp/cmacclass/cmacfree.c 1K a cmacclass_ftp/cmacclass/train.c 1K a cmacclass_ftp/cmacclass/3dgraphics.c 2K a cmacclass_ftp/cmacclass/cmacfile.c 2K a cmacclass_ftp/cmacclass/getlevels.c 1K a cmacclass_ftp/cmacclass/getnumberintervals.c 1K a cmacclass_ftp/cmacclass/func.fin 2K a cmacclass_ftp/cmacclass/getminx.c 1K a cmacclass_ftp/cmacclass/getmaxx.c 1K a cmacclass_ftp/cmacclass/getwidth.c 1K a cmacclass_ftp/cmacclass/loadinputsize.c 1K a cmacclass_ftp/cmacclass/loadoutputsize.c 1K a cmacclass_ftp/cmacclass/loadtrainsize.c 1K a cmacclass_ftp/cmacclass/loadtestsize.c 1K a cmacclass_ftp/cmacclass/getworkingaddress.c 1K a cmacclass_ftp/cmacclass/getinputsize.c 1K a cmacclass_ftp/cmacclass/getoutputsize.c 1K a cmacclass_ftp/utility/ 0K a cmacclass_ftp/utility/gettxt.c 1K a cmacclass_ftp/utility/normvec.c 1K a cmacclass_ftp/utility/MakeLibraryUtility 2K a cmacclass_ftp/utility/utility.h 1K a cmacclass_ftp/utility/2d_int.c 1K a cmacclass_ftp/utility/2d_char.c 1K a cmacclass_ftp/utility/2d_double.c 1K a cmacclass_ftp/utility/2d_float.c 1K a cmacclass_ftp/utility/2d_pointer2int.c 1K a cmacclass_ftp/usecmac/ 0K a cmacclass_ftp/usecmac/function/ 0K a cmacclass_ftp/usecmac/function/func.cfg 1K a cmacclass_ftp/usecmac/function/func_test.txt 2K a cmacclass_ftp/usecmac/function/funcinit.txt 1K a cmacclass_ftp/usecmac/function/graphit.txt 72K a cmacclass_ftp/usecmac/function/func_train.txt 4K a cmacclass_ftp/usecmac/function/setfunc.cfg 1K a cmacclass_ftp/usecmac/function/MakeApplication 2K a cmacclass_ftp/usecmac/function/simul.c 2K a cmacclass_ftp/usecmac/function/simul3.c 2K a cmacclass_ftp/usecmac/function/func.fin 4K a cmacclass_ftp/usecmac/function/simul.h 1K a cmacclass_ftp/usecmac/function/simul2.c 2K a cmacclass_ftp/usecmac/function/MakeApplication3 1K a cmacclass_ftp/usecmac/function/MakeApplication2 1K a cmacclass_ftp/usecmac/function/testmodel.c 4K a cmacclass_ftp/usecmac/function/MakeTest 2K a cmacclass_ftp/usecmac/function/test_generator.c 3K a cmacclass_ftp/usecmac/function/MakeGenerator 2K a cmacclass_ftp/usecmac/function/test1.txt 2K a cmacclass_ftp/usecmac/function/train1.txt 9K a cmacclass_ftp/usecmac/function/full1.txt 122K a cmacclass_ftp/usecmac/function/matlab1.txt 102K a cmacclass_ftp/usecmac/function/func2.cfg 1K a cmacclass_ftp/usecmac/function/matlab3.txt 102K a cmacclass_ftp/usecmac/function/func3.cfg 1K a cmacclass_ftp/Xheaders/ 0K a cmacclass_ftp/Xheaders/myconstants.h 1KThe size of the tar file is 586752 blocks. Then, the tar was compressed:
compress cmacclass_ftp.tarThe size of the compressed file is 147205 blocks. The compressed file can be obtained from our web site http://www.math.clemson.edu/ peterson.
uncompress cmacclass_ftp.tar.Z tar -xvf cmacclass_ftp.tarAfter this is done, you will have a folder cmacclass_ftp with subfolders usecmac, Xheaders, utility and cmacclass. First, build the utility library libutility.a from the source in the utility folder by typing
make -f MakeLibraryThen, the source in cmacclass is built by also typing
make -f MakeLibrarywhich will generate the libcmac.a library file. You will need to edit these MakeLibrary make files to reflect the proper paths that you are using to store these files. The paths are set up as follows to reflect our needs:
# -------------------------- #
# paths for this simulation #
# -------------------------- #
INCLUDE_PATH_UTILITY = /home/peterson/programs/utility
INCLUDE_PATH_CMAC = /home/peterson/programs/cmacclass
INCLUDE_PATH_CONSTANTS = /home/peterson/Xheaders
INCLUDES = -I$(INCLUDE_PATH_UTILITY) -I$(INCLUDE_PATH_CMAC) \
-I$(INCLUDE_PATH_CONSTANTS)
LIBRARY_PATH_UTILITY = /home/peterson/programs/utility
LIBRARY_PATH_CMAC = /home/peterson/programs/cmacclass
You will need to add your proper paths:
# -------------------------- #
# paths for this simulation #
# -------------------------- #
INCLUDE_PATH_UTILITY = (YOUR PATH)/utility
INCLUDE_PATH_CMAC = (YOUR PATH)/cmacclass
INCLUDE_PATH_CONSTANTS = (YOUR PATH)/Xheaders
INCLUDES = -I$(INCLUDE_PATH_UTILITY) -I$(INCLUDE_PATH_CMAC) \
-I$(INCLUDE_PATH_CONSTANTS)
LIBRARY_PATH_UTILITY = (YOUR PATH)/utility
LIBRARY_PATH_CMAC = (YOUR PATH)/cmacclass
Once the libraries are built, you can compile and use the
sample application code in the folder usecmac by
making appropriate changes in the relevant make files for
each application.
#include "cmac.h"
#define DESIRED_TOL (1.0e-6)
#define STOP_TOL (1.0e-5)
#define RUN_MAX (25)
#define FREQ (1)
void main(int argc,char *argv[])
{
int run,trainsize,testsize;
float **intr,**inte,**outtr,**outte,rms,rmstest;
CMAC cmac(argv[1]); // set up architecture
cmac.read_training_data(&intr,&outtr); //get training data
cmac.read_testing_data(&inte,&outte); //get testing data
cmac.initialize().number(); //initialize cmac object
cmac.gettrainsize(&trainsize).gettestsize(&testsize);
rmstest = cmac.compute_rms(testsize,inte,outte); //find rms on test set
rms = cmac.compute_rms(trainsize,intr,outtr); //find rms on training set
//train the architecture for RUN_MAX iterations
for(run=0;run<RUN_MAX;++run){
rmstest = cmac.compute_rms(testsize,inte,outte); //find rms on test set
rms = cmac.compute_rms(trainsize,intr,outtr); //find rms on training set
if(rms>STOP_TOL) //if rms is too large, keep training
cmac.train(1,DESIRED_TOL,trainsize,intr,outtr);
}//run loop
printf("rms[%3d] = %12.6e ",run,rms);
printf("rmstest[%3d] = %12.6e\n",run,rmstest);
cmac.write_wts(); //write the weights to a file
}
Note in the above code, we concantenate class
function calls as follows:cmac.gettrainsize(&trainsize).gettestsize(&testsize);
CMAC T(argv[1]); CMAC *cmac; cmac = new CMAC[1]; cmac[0] = T;or
CMAC T(argv[1]); CMAC cmac; cmac = T;and there will be no difference in the output of the application.
we use the term wetware to indicate things that are of neurobiological scope. We use double--edged arrows to indicate that ideas from these disciplines can both enhance and modify ideas from the others. The labels on the edges indicate possible intellectual pathways we can travel upon in our quest for unification and synthesis: ANALOG VLSI is an almost classical chip building strategy which in conjunction with the VHDL layout language provides us with a means to take neurobiological information and implement it on a silicon substrate; hardware and software of the kinds we envision are typically event driven ( and we will have much more to say about that issue); and abstraction is the principle tool that we can use to move back and forth in the two fertile grounds of neurobiology and software.
Figure 1.1: