forked from btgraham/SparseConvNet-archived
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpatiallySparseLayer.h
More file actions
31 lines (30 loc) · 1004 Bytes
/
SpatiallySparseLayer.h
File metadata and controls
31 lines (30 loc) · 1004 Bytes
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
#pragma once
#include <iostream>
#include "SpatiallySparseBatchInterface.h"
#include "SpatiallySparseBatch.h"
class SpatiallySparseLayer {
public:
SpatiallySparseBatchSubInterface sub;
virtual void preprocess
(SpatiallySparseBatch &batch,
SpatiallySparseBatchInterface &input,
SpatiallySparseBatchInterface &output) = 0;
virtual void forwards
(SpatiallySparseBatch &batch,
SpatiallySparseBatchInterface &input,
SpatiallySparseBatchInterface &output) = 0;
virtual void scaleWeights
(SpatiallySparseBatchInterface &input,
SpatiallySparseBatchInterface &output,
float& scalingUnderneath,
bool topLayer);
virtual void backwards
(SpatiallySparseBatch &batch,
SpatiallySparseBatchInterface &input,
SpatiallySparseBatchInterface &output,
float learningRate,
float momentum) = 0;
virtual void loadWeightsFromStream(std::ifstream &f);
virtual void putWeightsToStream(std::ofstream &f);
virtual int calculateInputSpatialSize(int outputSpatialSize) = 0;
};