Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
d4958e8a
"vscode:/vscode.git/clone" did not exist on "420eba0e6abe5c2f1881280f008ab5a17dbf97a3"
Commit
d4958e8a
authored
Oct 08, 2016
by
Davis King
Browse files
Evgeniy Fominov's changes that avoid compiler bugs in Visual Studio.
parent
c22b94c9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
15 deletions
+29
-15
examples/dnn_imagenet_ex.cpp
examples/dnn_imagenet_ex.cpp
+9
-5
examples/dnn_imagenet_train_ex.cpp
examples/dnn_imagenet_train_ex.cpp
+20
-10
No files found.
examples/dnn_imagenet_ex.cpp
View file @
d4958e8a
...
@@ -47,15 +47,19 @@ using block = BN<con<N,3,3,1,1,relu<BN<con<N,3,3,stride,stride,SUBNET>>>>>;
...
@@ -47,15 +47,19 @@ using block = BN<con<N,3,3,1,1,relu<BN<con<N,3,3,stride,stride,SUBNET>>>>>;
template
<
int
N
,
typename
SUBNET
>
using
ares
=
relu
<
residual
<
block
,
N
,
affine
,
SUBNET
>>
;
template
<
int
N
,
typename
SUBNET
>
using
ares
=
relu
<
residual
<
block
,
N
,
affine
,
SUBNET
>>
;
template
<
int
N
,
typename
SUBNET
>
using
ares_down
=
relu
<
residual_down
<
block
,
N
,
affine
,
SUBNET
>>
;
template
<
int
N
,
typename
SUBNET
>
using
ares_down
=
relu
<
residual_down
<
block
,
N
,
affine
,
SUBNET
>>
;
template
<
typename
SUBNET
>
using
level1
=
ares
<
512
,
ares
<
512
,
ares_down
<
512
,
SUBNET
>>>
;
template
<
typename
SUBNET
>
using
level2
=
ares
<
256
,
ares
<
256
,
ares
<
256
,
ares
<
256
,
ares
<
256
,
ares_down
<
256
,
SUBNET
>>>>>>
;
template
<
typename
SUBNET
>
using
level3
=
ares
<
128
,
ares
<
128
,
ares
<
128
,
ares_down
<
128
,
SUBNET
>>>>
;
template
<
typename
SUBNET
>
using
level4
=
ares
<
64
,
ares
<
64
,
ares
<
64
,
SUBNET
>>>
;
using
anet_type
=
loss_multiclass_log
<
fc
<
1000
,
avg_pool_everything
<
using
anet_type
=
loss_multiclass_log
<
fc
<
1000
,
avg_pool_everything
<
ares
<
512
,
ares
<
512
,
ares_down
<
512
,
level1
<
ares
<
256
,
ares
<
256
,
ares
<
256
,
ares
<
256
,
ares
<
256
,
ares_down
<
256
,
level2
<
ares
<
128
,
ares
<
128
,
ares
<
128
,
ares_down
<
128
,
level3
<
ares
<
64
,
ares
<
64
,
ares
<
64
,
level4
<
max_pool
<
3
,
3
,
2
,
2
,
relu
<
affine
<
con
<
64
,
7
,
7
,
2
,
2
,
max_pool
<
3
,
3
,
2
,
2
,
relu
<
affine
<
con
<
64
,
7
,
7
,
2
,
2
,
input_rgb_image_sized
<
227
>
input_rgb_image_sized
<
227
>
>>>>>>>>>>>>
>>>>>>>>>>>
;
>>>>>>>>>>>
;
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
examples/dnn_imagenet_train_ex.cpp
View file @
d4958e8a
...
@@ -40,25 +40,35 @@ template <int N, typename SUBNET> using ares_down = relu<residual_down<block,N,a
...
@@ -40,25 +40,35 @@ template <int N, typename SUBNET> using ares_down = relu<residual_down<block,N,a
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
typename
SUBNET
>
using
level1
=
res
<
512
,
res
<
512
,
res_down
<
512
,
SUBNET
>>>
;
template
<
typename
SUBNET
>
using
level2
=
res
<
256
,
res
<
256
,
res
<
256
,
res
<
256
,
res
<
256
,
res_down
<
256
,
SUBNET
>>>>>>
;
template
<
typename
SUBNET
>
using
level3
=
res
<
128
,
res
<
128
,
res
<
128
,
res_down
<
128
,
SUBNET
>>>>
;
template
<
typename
SUBNET
>
using
level4
=
res
<
64
,
res
<
64
,
res
<
64
,
SUBNET
>>>
;
template
<
typename
SUBNET
>
using
alevel1
=
ares
<
512
,
ares
<
512
,
ares_down
<
512
,
SUBNET
>>>
;
template
<
typename
SUBNET
>
using
alevel2
=
ares
<
256
,
ares
<
256
,
ares
<
256
,
ares
<
256
,
ares
<
256
,
ares_down
<
256
,
SUBNET
>>>>>>
;
template
<
typename
SUBNET
>
using
alevel3
=
ares
<
128
,
ares
<
128
,
ares
<
128
,
ares_down
<
128
,
SUBNET
>>>>
;
template
<
typename
SUBNET
>
using
alevel4
=
ares
<
64
,
ares
<
64
,
ares
<
64
,
SUBNET
>>>
;
// training network type
// training network type
using
net_type
=
loss_multiclass_log
<
fc
<
1000
,
avg_pool_everything
<
using
net_type
=
loss_multiclass_log
<
fc
<
1000
,
avg_pool_everything
<
res
<
512
,
res
<
512
,
res_down
<
512
,
level1
<
res
<
256
,
res
<
256
,
res
<
256
,
res
<
256
,
res
<
256
,
res_down
<
256
,
level2
<
res
<
128
,
res
<
128
,
res
<
128
,
res_down
<
128
,
level3
<
res
<
64
,
res
<
64
,
res
<
64
,
level4
<
max_pool
<
3
,
3
,
2
,
2
,
relu
<
bn_con
<
con
<
64
,
7
,
7
,
2
,
2
,
max_pool
<
3
,
3
,
2
,
2
,
relu
<
bn_con
<
con
<
64
,
7
,
7
,
2
,
2
,
input_rgb_image_sized
<
227
>
input_rgb_image_sized
<
227
>
>>>>>>>>>>>>
>>>>>>>>>>>
;
>>>>>>>>>>>
;
// testing network type (replaced batch normalization with fixed affine transforms)
// testing network type (replaced batch normalization with fixed affine transforms)
using
anet_type
=
loss_multiclass_log
<
fc
<
1000
,
avg_pool_everything
<
using
anet_type
=
loss_multiclass_log
<
fc
<
1000
,
avg_pool_everything
<
a
res
<
512
,
ares
<
512
,
ares_down
<
512
,
a
level1
<
a
res
<
256
,
ares
<
256
,
ares
<
256
,
ares
<
256
,
ares
<
256
,
ares_down
<
256
,
a
level2
<
a
res
<
128
,
ares
<
128
,
ares
<
128
,
ares_down
<
128
,
a
level3
<
a
res
<
64
,
ares
<
64
,
ares
<
64
,
a
level4
<
max_pool
<
3
,
3
,
2
,
2
,
relu
<
affine
<
con
<
64
,
7
,
7
,
2
,
2
,
max_pool
<
3
,
3
,
2
,
2
,
relu
<
affine
<
con
<
64
,
7
,
7
,
2
,
2
,
input_rgb_image_sized
<
227
>
input_rgb_image_sized
<
227
>
>>>>>>>>>>>>
>>>>>>>>>>>
;
>>>>>>>>>>>
;
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
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