mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-05 17:34:21 +00:00
Allocate activation on heap
This commit is contained in:
@@ -38,7 +38,7 @@ class AvgPooling2D : public SequentialLayer {
|
||||
|
||||
float* d_output;
|
||||
|
||||
Activation activation;
|
||||
Activation* activation;
|
||||
};
|
||||
|
||||
} // namespace CUDANet::Layers
|
||||
|
||||
@@ -120,8 +120,7 @@ class Conv2d : public WeightedLayer {
|
||||
float* d_weights;
|
||||
float* d_biases;
|
||||
|
||||
// Kernels
|
||||
Activation activation;
|
||||
Activation* activation;
|
||||
|
||||
/**
|
||||
* @brief Initialize weights of the convolutional layer with zeros
|
||||
|
||||
@@ -77,7 +77,7 @@ class Dense : public WeightedLayer {
|
||||
std::vector<float> weights;
|
||||
std::vector<float> biases;
|
||||
|
||||
Layers::Activation activation;
|
||||
Layers::Activation* activation;
|
||||
|
||||
// Precompute kernel launch parameters
|
||||
unsigned int forwardGridSize;
|
||||
|
||||
@@ -38,7 +38,7 @@ class MaxPooling2D : public SequentialLayer {
|
||||
|
||||
float* d_output;
|
||||
|
||||
Activation activation;
|
||||
Activation* activation;
|
||||
};
|
||||
|
||||
} // namespace CUDANet::Layers
|
||||
|
||||
Reference in New Issue
Block a user