mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-06 01:34:22 +00:00
50 lines
937 B
Plaintext
50 lines
937 B
Plaintext
#ifndef INPUT_LAYER_H
|
|
#define INPUT_LAYER_H
|
|
|
|
#include <ilayer.cuh>
|
|
|
|
namespace Layers {
|
|
|
|
/**
|
|
* @brief Input layer, just copies the input to the device
|
|
*
|
|
*/
|
|
class Input : public ILayer {
|
|
public:
|
|
/**
|
|
* @brief Create a new Input layer
|
|
*
|
|
* @param inputSize Size of the input vector
|
|
*/
|
|
Input(int inputSize);
|
|
|
|
/**
|
|
* @brief Destroy the Input layer
|
|
*
|
|
*/
|
|
~Input();
|
|
|
|
/**
|
|
* @brief Forward pass of the input layer. Just copies the input to the device
|
|
*
|
|
* @param input Host pointer to the input vector
|
|
* @return Device pointer to the output vector
|
|
*/
|
|
float* forward(const float* input);
|
|
|
|
void setWeights(const float* weights);
|
|
void setBiases(const float* biases);
|
|
|
|
private:
|
|
void initializeWeights();
|
|
void initializeBiases();
|
|
|
|
void toCuda();
|
|
|
|
int inputSize;
|
|
float* d_output;
|
|
};
|
|
|
|
} // namespace Layers
|
|
|
|
#endif // INPUT_LAYER_H |