Aquila  2.0 prealpha
Cognitive Robotics Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
kernels.cu File Reference
#include <cuda.h>
#include <cuda_runtime.h>

Functions

__global__ void propogateInputKernel (float *inputs, float *weights, float *outputs, int numInputs, int sequenceId, int numOutputs)
 Calculates the euclidean distance between input vector and weight vector of a neuron and saves these distances in the output array.
 
__global__ void findBestMatchPass1Kernel (float *outputs, int *winner, int numOutputs)
 Finds the best matching unit having the lowest euclidean distance - part 1/2.
 
__global__ void findBestMatchPass2Kernel (float *outputs, int *winner, int numOutputs)
 Finds the best matching unit having the lowest euclidean distance - part 2/2.
 
__global__ void updateWeightsKernel (float *inputs, float *weights, int *winner, float sigma, int numInputs, int sequenceId, int numOutputs, int neighbourhoodSize, float initLearningRate, int numIterations, int currentIteration)
 Updates weights of the self-organising map.
 
void findBestMatchOnDevice (dim3 grid, dim3 block, float *outputs, int *winner, int numOutputs)
 Wrapper for findBestMatchPass1Kernel and findBestMatchPass2Kernel.
 
void propogateInputOnDevice (dim3 grid, dim3 block, float *inputs, float *weights, float *outputs, int numInputs, int sequenceId, int numOutputs)
 Wrapper for propogateInputKernel.
 
void updateWeightsOnDevice (dim3 grid, dim3 block, float *inputs, float *weights, int *winner, float sigma, int numInputs, int sequenceId, int numOutputs, int neighbourhoodSize, float initLearningRate, int numIterations, int currentIteration)
 Wrapper for updateWeightsKernel.
 

Function Documentation

void findBestMatchOnDevice ( dim3  grid,
dim3  block,
float *  outputs,
int *  winner,
int  numOutputs 
)

Wrapper for findBestMatchPass1Kernel and findBestMatchPass2Kernel.

Parameters
[in]grid- CUDA grid size
[in]block- CUDA block size
[in]outputs- outputs
[in]numOutputs- number of outputs
[out]winner- winner
__global__ void findBestMatchPass1Kernel ( float *  outputs,
int *  winner,
int  numOutputs 
)

Finds the best matching unit having the lowest euclidean distance - part 1/2.

Parameters
[in]outputs- outputs
[in]numOutputs- number of outputs
[out]winner- winner
__global__ void findBestMatchPass2Kernel ( float *  outputs,
int *  winner,
int  numOutputs 
)

Finds the best matching unit having the lowest euclidean distance - part 2/2.

Parameters
[in]outputs- outputs
[in]numOutputs- number of outputs
[out]winner- winner
__global__ void propogateInputKernel ( float *  inputs,
float *  weights,
float *  outputs,
int  numInputs,
int  sequenceId,
int  numOutputs 
)

Calculates the euclidean distance between input vector and weight vector of a neuron and saves these distances in the output array.

Parameters
[in]inputs- inputs
[in]weights- weights
[in]numInputs- number of inputs
[in]sequenceId- sequence id
[in]numOutputs- number of outputs
[out]outputs- outputs
void propogateInputOnDevice ( dim3  grid,
dim3  block,
float *  inputs,
float *  weights,
float *  outputs,
int  numInputs,
int  sequenceId,
int  numOutputs 
)

Wrapper for propogateInputKernel.

Parameters
[in]grid- CUDA grid size
[in]block- CUDA block size
[in]inputs- inputs
[in]weights- weights
[in]numInputs- number of inputs
[in]sequenceId- sequence id
[in]numOutputs- number of outputs
[out]outputs- outputs
__global__ void updateWeightsKernel ( float *  inputs,
float *  weights,
int *  winner,
float  sigma,
int  numInputs,
int  sequenceId,
int  numOutputs,
int  neighbourhoodSize,
float  initLearningRate,
int  numIterations,
int  currentIteration 
)

Updates weights of the self-organising map.

Parameters
[in]inputs- inputs
[in]winner- winner
[in]sigma- sigma
[in]numInputs- number of inputs
[in]sequenceId- sequence id
[in]numOutputs- number of outputs
[in]neighbourhoodSize- neighbourhood size
[in]numIterations- number of iterations
[in]currentIteration- current iteration
[out]weights- weights
void updateWeightsOnDevice ( dim3  grid,
dim3  block,
float *  inputs,
float *  weights,
int *  winner,
float  sigma,
int  numInputs,
int  sequenceId,
int  numOutputs,
int  neighbourhoodSize,
float  initLearningRate,
int  numIterations,
int  currentIteration 
)

Wrapper for updateWeightsKernel.

Parameters
[in]grid- CUDA grid size
[in]block- CUDA block size
[in]inputs- inputs
[in]winner- winner
[in]sigma- sigma
[in]numInputs- number of inputs
[in]sequenceId- sequence id
[in]numOutputs- number of outputs
[in]neighbourhoodSize- neighbourhood size
[in]numIterations- number of iterations
[in]currentIteration- current iteration
[out]weights- weights