MagmaDNN
1.0
c++NeuralNetworkFramework
fullyconnectedlayer.h
Go to the documentation of this file.
1
9
#include <vector>
10
#include "
layer/layer.h
"
11
#include "
tensor/tensor.h
"
12
#include "
compute/operation.h
"
13
#include "compute/tensor_operations.h"
14
15
namespace
magmadnn
{
16
namespace
layer {
17
18
template
<
typename
T>
19
class
FullyConnectedLayer
:
public
Layer
<T> {
20
public
:
21
FullyConnectedLayer
(
op::Operation<T>
*input,
unsigned
int
hidden_units,
bool
use_bias=
true
);
22
virtual
~
FullyConnectedLayer
();
23
24
virtual
std::vector<op::Operation<T> *> get_weights();
25
26
op::Operation<T>
*get_weight() {
return
weights; }
27
op::Operation<T>
*get_bias() {
return
bias; }
28
29
protected
:
30
void
init();
31
32
unsigned
int
hidden_units;
33
bool
use_bias;
34
35
Tensor<T>
*weights_tensor;
36
Tensor<T>
*bias_tensor;
37
38
op::Operation<T>
*weights;
39
op::Operation<T>
*bias;
40
41
};
42
43
template
<
typename
T>
44
FullyConnectedLayer<T>
* fullyconnected(
op::Operation<T>
*input,
unsigned
int
hidden_units,
bool
use_bias=
true
);
45
46
}
// layer
47
}
// magmadnn
layer.h
magmadnn::layer::FullyConnectedLayer
Definition:
fullyconnectedlayer.h:19
magmadnn
Definition:
addop.cpp:11
tensor.h
magmadnn::Tensor
Definition:
tensor.h:34
operation.h
magmadnn::layer::Layer
Definition:
layer.h:18
magmadnn::op::Operation
Definition:
operation.h:18
include
layer
fullyconnected
fullyconnectedlayer.h
Generated by
1.8.13