mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-06 01:34:22 +00:00
Implement output layer
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#ifndef CUDANET_CONV_LAYER_H
|
||||
#define CUDANET_CONV_LAYER_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "activation.cuh"
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef CUDANET_DENSE_LAYER_H
|
||||
#define CUDANET_DENSE_LAYER_H
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "layer.cuh"
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
#ifndef CUDANET_I_LAYER_H
|
||||
#define CUDANET_I_LAYER_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace CUDANet::Layers {
|
||||
|
||||
/**
|
||||
|
||||
39
include/layers/output.cuh
Normal file
39
include/layers/output.cuh
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef CUDANET_OUTPUT_LAYER_H
|
||||
#define CUDANET_OUTPUT_LAYER_H
|
||||
|
||||
#include "layer.cuh"
|
||||
|
||||
namespace CUDANet::Layers {
|
||||
|
||||
class Output : public SequentialLayer {
|
||||
public:
|
||||
/**
|
||||
* @brief Create a new Output layer
|
||||
*
|
||||
* @param inputSize Size of the input vector
|
||||
*/
|
||||
explicit Output(int inputSize);
|
||||
|
||||
/**
|
||||
* @brief Destroy the Output layer
|
||||
*
|
||||
*/
|
||||
~Output();
|
||||
|
||||
/**
|
||||
* @brief Forward pass of the output layer. Just copies the input from device to host
|
||||
*
|
||||
* @param input Device pointer to the input vector
|
||||
* @return Host pointer to the output vector
|
||||
*/
|
||||
float* forward(const float* input);
|
||||
|
||||
private:
|
||||
int inputSize;
|
||||
float* h_output;
|
||||
};
|
||||
|
||||
|
||||
} // namespace CUDANet::Layers
|
||||
|
||||
#endif // CUDANET_OUTPUT_LAYER_H
|
||||
@@ -4,7 +4,9 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "layer.cuh"
|
||||
#include "input.cuh"
|
||||
|
||||
namespace CUDANet {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user