-
Notifications
You must be signed in to change notification settings - Fork 85
/
net.cuh
55 lines (46 loc) · 1.17 KB
/
net.cuh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef _NET_CUH_
#define _NET_CUH_
#include "common/cuMatrix.h"
#include <vector>
#include <stdio.h>
#include <cuda_runtime.h>
#include "common/cuMatrixVector.h"
/*
*function : read the network weight from checkpoint
* parameter :
* vector<Cvl> &ConvLayers: convolution
* vector<Ntw> &FullLayers: Full connect
* SMR &smr : softmax
* int imgDim : Image Size
* int nsamples : number of samples
*/
void cuReadConvNet(
int imgDim,
const char* path,
int nclasses);
/*
*function: trainning the network
*/
void cuTrainNetwork(cuMatrixVector<float>&x,
cuMatrix<int>*y ,
cuMatrixVector<float>& testX,
cuMatrix<int>* testY,
int batch,
int ImgSize,
int nclasses,
std::vector<float>&nlrate,
std::vector<float>&nMomentum,
std::vector<int>&epoCount,
cublasHandle_t handle);
void buildNetWork(int trainLen, int testLen);
void cuFreeConvNet();
void cuFreeCNNMemory(
int batch,
cuMatrixVector<float>&trainX,
cuMatrixVector<float>&testX);
int cuVoteAdd(cuMatrix<int>*& voteSum,
cuMatrix<int>*& predict,
cuMatrix<int>*& testY,
cuMatrix<int>*& correct,
int nclasses);
#endif