-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbuildNet.m
34 lines (29 loc) · 1015 Bytes
/
buildNet.m
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
function net = buildNet(inputSize, outputSize, options)
%==========================================================================
% buildNet constucts the deep neural network
%
%
%==========================================================================
switch options.netType
case 'Plain'
vecInput = imageInputLayer(inputSize, 'Name', 'input');
fc1 = fullyConnectedLayer(8192,'Name','fc1');
relu1 = reluLayer('Name','relu1');
drop1 = dropoutLayer(0.02,'Name','drop1');
fc2 = fullyConnectedLayer(8192,'Name','fc2');
relu2 = reluLayer('Name','relu2');
drop2 = dropoutLayer(0.02,'Name','drop2');
fc3 = fullyConnectedLayer(outputSize, 'Name', 'fc3');
regOutput = nmseReg('regOutput');
layers = [...
vecInput
fc1
relu1
drop1
fc2
relu2
drop2
fc3
regOutput];
net = layerGraph(layers);
end