home *** CD-ROM | disk | FTP | other *** search
/ Robotics & Artificial Int…3 (Professional Edition) / Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso / neural network tool and application / nsinstall.exe / data1.cab / DLLCust_Files / AXON / BKSQUARE.C < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-08  |  1.2 KB  |  39 lines

  1. // Dynamic link library implementation of NeuroSolutions BackAxon component 
  2.  
  3. #include "NSDLL.h" 
  4.  
  5. /* Backpropagation of component */
  6.  
  7. __declspec(dllexport) void performBackAxon(
  8.     DLLData    *instance,    // Pointer to instance data (may be NULL)
  9.     DLLData    *dualInstance,    // Pointer to forward axonÆs instance data (may be NULL)
  10.     NSFloat    *data,         // Pointer to the layer of processing elements (PEs)
  11.     int     rows,        // Number of rows of PEs in the layer
  12.     int     cols,        // Number of columns of PEs in the layer
  13.     NSFloat    *error         // Pointer to the sensitivity vector
  14.     )
  15. {
  16.     int i, length=rows*cols;
  17.     for (i=0; i<length; i++)
  18.         error[i] *= 2*(NSFloat)pow(data[i], 0.5);
  19. }
  20.  
  21. /******************************************/
  22. /* Management of instance data (OPTIONAL) */
  23. /*
  24. __declspec(dllexport) DLLData *allocBackAxon(
  25.     DLLData    *oldInstance,    // Pointer to the last instance if reallocating
  26.     DLLData    *dualInstance,    // Pointer to forward axonÆs instance data (may be NULL)
  27.     int     rows,        // Number of rows of PEs in the layer
  28.     int     cols        // Number of columns of PEs in the layer
  29.     )
  30. {
  31.     DLLData *instance = allocDLLInstance(oldInstance);
  32.     return instance;
  33. }
  34.  
  35. __declspec(dllexport) void freeBackAxon(DLLData *instance)
  36. {
  37.     freeDLLInstance(instance);
  38. }
  39. */