mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-06 01:34:22 +00:00
Add Kernels namespace
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "activations.cuh"
|
||||
#include "padding.cuh"
|
||||
#include "convolution.cuh"
|
||||
#include "ilayer.cuh"
|
||||
|
||||
namespace Layers {
|
||||
@@ -13,13 +13,13 @@ namespace Layers {
|
||||
class Conv2d : public ILayer {
|
||||
public:
|
||||
Conv2d(
|
||||
int inputSize,
|
||||
int inputChannels,
|
||||
int kernelSize,
|
||||
int stride,
|
||||
Padding padding,
|
||||
int numFilters,
|
||||
Activation activation
|
||||
int inputSize,
|
||||
int inputChannels,
|
||||
int kernelSize,
|
||||
int stride,
|
||||
Layers::Padding padding,
|
||||
int numFilters,
|
||||
Layers::Activation activation
|
||||
);
|
||||
~Conv2d();
|
||||
|
||||
@@ -52,7 +52,7 @@ class Conv2d : public ILayer {
|
||||
float* d_padded;
|
||||
|
||||
// Kernels
|
||||
Activation activation;
|
||||
Layers::Activation activation;
|
||||
|
||||
void initializeWeights();
|
||||
void initializeBiases();
|
||||
|
||||
@@ -14,7 +14,7 @@ class Dense : public ILayer {
|
||||
Dense(
|
||||
int inputSize,
|
||||
int outputSize,
|
||||
Activation activation
|
||||
Layers::Activation activation
|
||||
);
|
||||
~Dense();
|
||||
|
||||
@@ -32,7 +32,7 @@ class Dense : public ILayer {
|
||||
std::vector<float> weights;
|
||||
std::vector<float> biases;
|
||||
|
||||
Activation activation;
|
||||
Layers::Activation activation;
|
||||
|
||||
void initializeWeights();
|
||||
void initializeBiases();
|
||||
|
||||
@@ -6,6 +6,17 @@
|
||||
|
||||
namespace Layers {
|
||||
|
||||
enum Activation {
|
||||
SIGMOID,
|
||||
RELU,
|
||||
NONE
|
||||
};
|
||||
|
||||
enum Padding {
|
||||
SAME,
|
||||
VALID
|
||||
};
|
||||
|
||||
class ILayer {
|
||||
public:
|
||||
virtual ~ILayer() {}
|
||||
@@ -29,7 +40,7 @@ class ILayer {
|
||||
std::vector<float> weights;
|
||||
std::vector<float> biases;
|
||||
|
||||
Activation activation;
|
||||
Layers::Activation activation;
|
||||
};
|
||||
|
||||
} // namespace Layers
|
||||
|
||||
Reference in New Issue
Block a user