forked from btgraham/SparseConvNet-archived
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReallyConvolutionalLayer.h
More file actions
52 lines (50 loc) · 1.59 KB
/
ReallyConvolutionalLayer.h
File metadata and controls
52 lines (50 loc) · 1.59 KB
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
#pragma once
#include "SpatiallySparseLayer.h"
class ReallyConvolutionalLayer : public SpatiallySparseLayer {
private:
int fs;
RNG rng;
float leaky;
public:
int inSpatialSize;
int outSpatialSize;
int filterSize;
int filterStride;
int dimension;
ActivationFunction fn;
int nFeaturesIn;
int nFeaturesOut;
float dropout;
int minActiveInputs;
vectorCUDA<float> W; //Weights
vectorCUDA<float> MW; //momentum
vectorCUDA<float> w; //shrunk versions
vectorCUDA<float> dw; //For backprop
vectorCUDA<float> B; //Weights
vectorCUDA<float> MB; //momentum
vectorCUDA<float> b; //shrunk versions
vectorCUDA<float> db; //For backprop
ReallyConvolutionalLayer(int nFeaturesIn,
int nFeaturesOut,
int filterSize,
int filterStride,
int dimension,
ActivationFunction fn,
float dropout,
int minActiveInputs=1,
float poolingToFollow=1);
void preprocess
(SpatiallySparseBatch &batch,
SpatiallySparseBatchInterface &input,
SpatiallySparseBatchInterface &output);
void forwards
(SpatiallySparseBatch &batch,
SpatiallySparseBatchInterface &input,
SpatiallySparseBatchInterface &output);
void backwards(SpatiallySparseBatch &batch,
SpatiallySparseBatchInterface &input,
SpatiallySparseBatchInterface &output,
float learningRate,
float momentum);
int calculateInputSpatialSize(int outputSpatialSize);
};