mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-06 01:34:22 +00:00
Rename hheader files to .cuh
This commit is contained in:
38
include/layers/dense.cuh
Normal file
38
include/layers/dense.cuh
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef DENSE_LAYER_H
|
||||
#define DENSE_LAYER_H
|
||||
|
||||
#include <vector>
|
||||
#include <cublas_v2.h>
|
||||
#include <ilayer.cuh>
|
||||
|
||||
namespace Layers {
|
||||
|
||||
class Dense : public ILayer {
|
||||
public:
|
||||
Dense(int inputSize, int outputSize, cublasHandle_t cublasHandle);
|
||||
~Dense();
|
||||
|
||||
void forward(const float* input, float* output);
|
||||
void setWeights(const std::vector<std::vector<float>>& weights);
|
||||
void setBiases(const std::vector<float>& biases);
|
||||
|
||||
private:
|
||||
int inputSize;
|
||||
int outputSize;
|
||||
|
||||
cublasHandle_t cublasHandle;
|
||||
|
||||
float* d_weights;
|
||||
float* d_biases;
|
||||
|
||||
std::vector<float> weights;
|
||||
std::vector<float> biases;
|
||||
|
||||
void initializeWeights();
|
||||
void initializeBiases();
|
||||
void toCuda();
|
||||
};
|
||||
|
||||
} // namespace Layers
|
||||
|
||||
#endif // DENSE_LAYER_H
|
||||
Reference in New Issue
Block a user