-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathImproved_ReEsNet.m
68 lines (56 loc) · 2.71 KB
/
Improved_ReEsNet.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
lgraph = layerGraph();
tempLayers = [
imageInputLayer(Input_Layer_Size,"Name","imageinput")
convolution2dLayer([3 3],16,"Name","conv_1","Padding","same")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],16,"Name","conv_2","Padding","same")
reluLayer("Name","relu_1")
convolution2dLayer([3 3],16,"Name","conv_3","Padding","same")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = additionLayer(2,"Name","addition_1");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],16,"Name","conv_4","Padding","same")
reluLayer("Name","relu_2")
convolution2dLayer([3 3],16,"Name","conv_5","Padding","same")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = additionLayer(2,"Name","addition_2");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],16,"Name","conv_6","Padding","same")
reluLayer("Name","relu_3")
convolution2dLayer([3 3],16,"Name","conv_7","Padding","same")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = additionLayer(2,"Name","addition_3");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],16,"Name","conv_8","Padding","same")
reluLayer("Name","relu_4")
convolution2dLayer([3 3],16,"Name","conv_9","Padding","same")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
additionLayer(2,"Name","addition_4")
convolution2dLayer([3 3],16,"Name","conv_10","Padding","same")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
additionLayer(2,"Name","addition_5")
resize2dLayer("Name","resize-output-size","GeometricTransformMode","half-pixel","Method","bilinear","NearestRoundingMode","round","OutputSize",[72 14])
convolution2dLayer([3 3],2,"Name","conv_11","Padding","same")
regressionLayer("Name","regressionoutput")];
lgraph = addLayers(lgraph,tempLayers);
clear tempLayers;
lgraph = connectLayers(lgraph,"conv_1","conv_2");
lgraph = connectLayers(lgraph,"conv_1","addition_1/in1");
lgraph = connectLayers(lgraph,"conv_1","addition_5/in2");
lgraph = connectLayers(lgraph,"conv_3","addition_1/in2");
lgraph = connectLayers(lgraph,"addition_1","conv_4");
lgraph = connectLayers(lgraph,"addition_1","addition_2/in1");
lgraph = connectLayers(lgraph,"conv_5","addition_2/in2");
lgraph = connectLayers(lgraph,"addition_2","conv_6");
lgraph = connectLayers(lgraph,"addition_2","addition_3/in1");
lgraph = connectLayers(lgraph,"conv_7","addition_3/in2");
lgraph = connectLayers(lgraph,"addition_3","conv_8");
lgraph = connectLayers(lgraph,"addition_3","addition_4/in1");
lgraph = connectLayers(lgraph,"conv_9","addition_4/in2");
lgraph = connectLayers(lgraph,"conv_10","addition_5/in1");