-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dense.h
57 lines (48 loc) · 1.04 KB
/
Dense.h
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
56
57
//
// Created by mikemerzl on 19/12/2019.
//
#ifndef Ex1_DENSE_H
#define Ex1_DENSE_H
#include "Activation.h"
/**
* Dense object
*/
class Dense
{
public:
/**
* Con for Dense class
* @param w :wieghts
* @param bias :bias
* @param type :ActiovationType
*/
Dense(Matrix & w , Matrix & bias , ActivationType type) : weights(w) , bias(bias) ,
activation(type)
{};
/**
* Get the cur weights.
* @return Matrix of weights.
*/
Matrix getWeights() const;
/**
* Get Bias Matrix
* @return Bias Matrix
*/
Matrix getBias() const;
/**
* Returns the activation function of this layer
* @return activation function of this layer
*/
Activation getActivation();
/**
* Applies the layer on input and returns output matrix
* @param input : Matrix
* @return Matrix after layer
*/
const Matrix operator()(const Matrix & input);
private:
Matrix & weights;
Matrix & bias;
ActivationType activation;
};
#endif //Ex1_DENSE_H