Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
bbb14d37
Commit
bbb14d37
authored
Jun 28, 2017
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9003 from dkurt:halide_bug_fixes
parents
2ae84909
121789f7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
21 deletions
+28
-21
elementwise_layers.cpp
modules/dnn/src/layers/elementwise_layers.cpp
+1
-1
fully_connected_layer.cpp
modules/dnn/src/layers/fully_connected_layer.cpp
+0
-1
test_halide_layers.cpp
modules/dnn/test/test_halide_layers.cpp
+27
-19
No files found.
modules/dnn/src/layers/elementwise_layers.cpp
View file @
bbb14d37
...
...
@@ -234,7 +234,7 @@ struct ReLUFunctor
Halide
::
Var
x
(
"x"
),
y
(
"y"
),
c
(
"c"
),
n
(
"n"
);
if
(
slope
)
{
top
(
x
,
y
,
c
,
n
)
=
select
(
input
>=
0.0
f
,
input
,
slope
);
top
(
x
,
y
,
c
,
n
)
=
select
(
input
>=
0.0
f
,
input
,
slope
*
input
);
}
else
{
...
...
modules/dnn/src/layers/fully_connected_layer.cpp
View file @
bbb14d37
...
...
@@ -78,7 +78,6 @@ public:
wpadding
.
setTo
(
Scalar
::
all
(
0.
));
weightsMat
=
weightsBuf
.
colRange
(
0
,
vecsize
);
blobs
[
0
].
copyTo
(
weightsMat
);
blobs
[
0
]
=
weightsMat
;
}
if
(
bias
)
...
...
modules/dnn/test/test_halide_layers.cpp
View file @
bbb14d37
...
...
@@ -430,7 +430,7 @@ TEST_P(ReLU, Accuracy)
}
INSTANTIATE_TEST_CASE_P
(
Layer_Test_Halide
,
ReLU
,
Values
(
/*negative slope*/
2.0
f
,
0.3
f
,
-
0.1
f
/*negative slope*/
2.0
f
,
0.3
f
,
-
0.1
f
,
0.0
f
));
typedef
TestWithParam
<
tuple
<
std
::
string
>
>
NoParamActivation
;
...
...
@@ -515,12 +515,7 @@ TEST_P(Concat, Accuracy)
Net
net
;
LayerParams
concatParam
;
concatParam
.
type
=
"Concat"
;
concatParam
.
name
=
"testLayer"
;
int
concatId
=
net
.
addLayer
(
concatParam
.
name
,
concatParam
.
type
,
concatParam
);
net
.
connect
(
0
,
0
,
concatId
,
0
);
std
::
vector
<
int
>
convLayerIds
(
numChannels
.
channels
);
for
(
int
i
=
0
,
n
=
numChannels
.
channels
;
i
<
n
;
++
i
)
{
if
(
!
numChannels
[
i
])
...
...
@@ -540,9 +535,18 @@ TEST_P(Concat, Accuracy)
convParam
.
name
=
ss
.
str
();
convParam
.
blobs
.
push_back
(
weights
);
int
convId
=
net
.
addLayer
(
convParam
.
name
,
convParam
.
type
,
convParam
);
net
.
connect
(
0
,
0
,
convId
,
0
);
net
.
connect
(
convId
,
0
,
concatId
,
i
+
1
);
convLayerIds
[
i
]
=
net
.
addLayer
(
convParam
.
name
,
convParam
.
type
,
convParam
);
net
.
connect
(
0
,
0
,
convLayerIds
[
i
],
0
);
}
LayerParams
concatParam
;
concatParam
.
type
=
"Concat"
;
concatParam
.
name
=
"testLayer"
;
int
concatId
=
net
.
addLayer
(
concatParam
.
name
,
concatParam
.
type
,
concatParam
);
net
.
connect
(
0
,
0
,
concatId
,
0
);
for
(
int
i
=
0
;
i
<
convLayerIds
.
size
();
++
i
)
{
net
.
connect
(
convLayerIds
[
i
],
0
,
concatId
,
i
+
1
);
}
Mat
input
({
1
,
inSize
[
0
],
inSize
[
1
],
inSize
[
2
]},
CV_32F
);
...
...
@@ -578,12 +582,7 @@ TEST_P(Eltwise, Accuracy)
Net
net
;
LayerParams
eltwiseParam
;
eltwiseParam
.
type
=
"Eltwise"
;
eltwiseParam
.
name
=
"testLayer"
;
int
eltwiseId
=
net
.
addLayer
(
eltwiseParam
.
name
,
eltwiseParam
.
type
,
eltwiseParam
);
net
.
connect
(
0
,
0
,
eltwiseId
,
0
);
std
::
vector
<
int
>
convLayerIds
(
numConv
);
for
(
int
i
=
0
;
i
<
numConv
;
++
i
)
{
Mat
weights
({
inSize
[
0
],
inSize
[
0
],
1
,
1
},
CV_32F
);
...
...
@@ -600,9 +599,18 @@ TEST_P(Eltwise, Accuracy)
convParam
.
name
=
ss
.
str
();
convParam
.
blobs
.
push_back
(
weights
);
int
convId
=
net
.
addLayer
(
convParam
.
name
,
convParam
.
type
,
convParam
);
net
.
connect
(
0
,
0
,
convId
,
0
);
net
.
connect
(
convId
,
0
,
eltwiseId
,
i
+
1
);
convLayerIds
[
i
]
=
net
.
addLayer
(
convParam
.
name
,
convParam
.
type
,
convParam
);
net
.
connect
(
0
,
0
,
convLayerIds
[
i
],
0
);
}
LayerParams
eltwiseParam
;
eltwiseParam
.
type
=
"Eltwise"
;
eltwiseParam
.
name
=
"testLayer"
;
int
eltwiseId
=
net
.
addLayer
(
eltwiseParam
.
name
,
eltwiseParam
.
type
,
eltwiseParam
);
net
.
connect
(
0
,
0
,
eltwiseId
,
0
);
for
(
int
i
=
0
;
i
<
numConv
;
++
i
)
{
net
.
connect
(
convLayerIds
[
i
],
0
,
eltwiseId
,
i
+
1
);
}
Mat
input
({
1
,
inSize
[
0
],
inSize
[
1
],
inSize
[
2
]},
CV_32F
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment