Initial model implementation

This commit is contained in:
2024-03-20 22:31:39 +01:00
parent 6f4cdf3792
commit af6838e8ae
4 changed files with 76 additions and 2 deletions

View File

@@ -1,20 +1,22 @@
#ifndef CUDANET_INPUT_LAYER_H
#define CUDANET_INPUT_LAYER_H
#include "layer.cuh"
namespace CUDANet::Layers {
/**
* @brief Input layer, just copies the input to the device
*
*/
class Input {
class Input : public SequentialLayer {
public:
/**
* @brief Create a new Input layer
*
* @param inputSize Size of the input vector
*/
Input(int inputSize);
explicit Input(int inputSize);
/**
* @brief Destroy the Input layer

34
include/model/model.hpp Normal file
View File

@@ -0,0 +1,34 @@
#ifndef CUDANET_MODEL_H
#define CUDANET_MODEL_H
#include <string>
#include <vector>
#include <map>
#include "layer.cuh"
namespace CUDANet {
class Model {
public:
Model(const int inputSize, const int inputChannels);
~Model();
float* predict(const float* input);
void addLayer(const std::string& name, Layers::SequentialLayer* layer);
private:
int inputSize;
int inputChannels;
int outputSize;
std::vector<Layers::SequentialLayer*> layers;
std::map<std::string, Layers::WeightedLayer*> layerMap;
};
} // namespace CUDANet
#endif // CUDANET_MODEL_H