Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
e2d4b3c4
Commit
e2d4b3c4
authored
Jun 12, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made layer() work on const networks.
parent
8f3e8a6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
core.h
dlib/dnn/core.h
+49
-0
No files found.
dlib/dnn/core.h
View file @
e2d4b3c4
...
@@ -2448,6 +2448,55 @@ namespace dlib
...
@@ -2448,6 +2448,55 @@ namespace dlib
return
n
.
get_repeated_layer
(
0
);
return
n
.
get_repeated_layer
(
0
);
}
}
};
};
template
<
unsigned
int
i
,
size_t
N
,
template
<
typename
>
class
L
,
typename
S
>
struct
layer_helper
<
i
,
const
repeat
<
N
,
L
,
S
>
,
typename
std
::
enable_if
<
(
i
!=
0
&&
i
>=
repeat
<
N
,
L
,
S
>::
layers_in_repeated_group
)
>::
type
>
{
const
static
size_t
layers_in_repeated_group
=
repeat
<
N
,
L
,
S
>::
layers_in_repeated_group
;
static
const
repeat
<
N
,
L
,
S
>&
makeT
();
using
next_type
=
const
typename
std
::
remove_reference
<
decltype
(
makeT
().
subnet
())
>::
type
;
using
type
=
const
typename
layer_helper
<
i
-
layers_in_repeated_group
,
next_type
>::
type
;
static
type
&
layer
(
const
repeat
<
N
,
L
,
S
>&
n
)
{
return
layer_helper
<
i
-
layers_in_repeated_group
,
next_type
>::
layer
(
n
.
subnet
());
}
};
template
<
unsigned
int
i
,
size_t
N
,
template
<
typename
>
class
L
,
typename
S
>
struct
layer_helper
<
i
,
const
repeat
<
N
,
L
,
S
>
,
typename
std
::
enable_if
<
(
i
!=
0
&&
i
<
repeat
<
N
,
L
,
S
>::
layers_in_repeated_group
)
>::
type
>
{
const
static
size_t
layers_in_each_group
=
repeat
<
N
,
L
,
S
>::
layers_in_each_group
;
typedef
typename
repeat
<
N
,
L
,
S
>::
repeated_layer_type
repeated_layer_type
;
using
next_type
=
const
repeated_layer_type
;
using
type
=
const
typename
layer_helper
<
i
%
layers_in_each_group
,
next_type
>::
type
;
static
type
&
layer
(
const
repeat
<
N
,
L
,
S
>&
n
)
{
return
layer_helper
<
i
%
layers_in_each_group
,
next_type
>::
layer
(
n
.
get_repeated_layer
(
i
/
layers_in_each_group
));
}
};
template
<
size_t
N
,
template
<
typename
>
class
L
,
typename
S
>
struct
layer_helper
<
0
,
const
repeat
<
N
,
L
,
S
>
,
void
>
{
typedef
typename
repeat
<
N
,
L
,
S
>::
repeated_layer_type
repeated_layer_type
;
using
type
=
const
repeated_layer_type
;
static
type
&
layer
(
const
repeat
<
N
,
L
,
S
>&
n
)
{
return
n
.
get_repeated_layer
(
0
);
}
};
template
<
typename
T
>
template
<
typename
T
>
struct
layer_helper
<
0
,
T
,
void
>
struct
layer_helper
<
0
,
T
,
void
>
{
{
...
...
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