Add activations enum

This commit is contained in:
2024-03-03 15:24:54 +01:00
parent 7e4460cc5e
commit f37320594a
4 changed files with 33 additions and 22 deletions

View File

@@ -10,4 +10,10 @@ relu_kernel(const float* __restrict__ src, float* __restrict__ dst, int len);
__global__ void
linear_kernel(const float* __restrict__ src, float* __restrict__ dst, int len);
enum Activation {
SIGMOID,
RELU,
LINEAR
};
#endif // ACTIVATIONS_H

View File

@@ -16,7 +16,7 @@ class Dense : public ILayer {
Dense(
int inputSize,
int outputSize,
std::string activation,
Activation activation,
cublasHandle_t cublasHandle
);
~Dense();
@@ -37,7 +37,7 @@ class Dense : public ILayer {
std::vector<float> weights;
std::vector<float> biases;
std::string activation;
Activation activation;
void initializeWeights();
void initializeBiases();