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
7f7ddcaa
Commit
7f7ddcaa
authored
Sep 28, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Plain Diff
merged
parents
20536bec
27f04a37
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
85 deletions
+85
-85
array2d_kernel.h
dlib/array2d/array2d_kernel.h
+1
-1
core.h
dlib/dnn/core.h
+14
-14
core_abstract.h
dlib/dnn/core_abstract.h
+66
-66
input_abstract.h
dlib/dnn/input_abstract.h
+4
-4
No files found.
dlib/array2d/array2d_kernel.h
View file @
7f7ddcaa
...
...
@@ -161,7 +161,7 @@ namespace dlib
}
#ifdef DLIB_HAS_RVALUE_REFERENCES
array2d
(
array2d
&&
item
)
array2d
(
array2d
&&
item
)
:
array2d
()
{
swap
(
item
);
}
...
...
dlib/dnn/core.h
View file @
7f7ddcaa
...
...
@@ -51,25 +51,25 @@ namespace dlib
template
<
typename
T
,
size_t
N
>
class
sstack
{
public
:
static_assert
(
N
>
0
,
"You can't create an empty sstack."
);
typedef
T
value_type
;
const
static
size_t
num_elements
=
N
;
public
:
static_assert
(
N
>
0
,
"You can't create an empty sstack."
);
typedef
T
value_type
;
const
static
size_t
num_elements
=
N
;
sstack
()
{}
sstack
(
const
T
&
item_
)
:
item
(
item_
),
data
(
item_
)
{}
sstack
()
{}
sstack
(
const
T
&
item_
)
:
item
(
item_
),
data
(
item_
)
{}
const
T
&
top
()
const
{
return
item
;
}
T
&
top
()
{
return
item
;
}
const
T
&
top
()
const
{
return
item
;
}
T
&
top
()
{
return
item
;
}
size_t
size
()
const
{
return
N
;
}
size_t
size
()
const
{
return
N
;
}
const
sstack
<
T
,
N
-
1
>&
pop
()
const
{
return
data
;
}
sstack
<
T
,
N
-
1
>&
pop
()
{
return
data
;
}
const
sstack
<
T
,
N
-
1
>&
pop
()
const
{
return
data
;
}
sstack
<
T
,
N
-
1
>&
pop
()
{
return
data
;
}
private
:
T
item
;
sstack
<
T
,
N
-
1
>
data
;
private
:
T
item
;
sstack
<
T
,
N
-
1
>
data
;
};
template
<
typename
T
>
...
...
dlib/dnn/core_abstract.h
View file @
7f7ddcaa
...
...
@@ -52,72 +52,72 @@ namespace dlib
entirely allocated on the stack.
!*/
public
:
typedef
T
value_type
;
const
static
size_t
num_elements
=
N
;
sstack
(
);
/*!
ensures
- #size() == N
- All elements of this stack are default constructed.
!*/
sstack
(
const
T
&
item
);
/*!
ensures
- #size() == N
- Initializes all N elements in this stack with the given item
.
E.g.
top()==item, pop().top()==item, pop().pop().top()==item, etc.
!*/
const
T
&
top
(
)
const
;
/*!
ensures
- returns the top element of the stack.
!*/
T
&
top
(
);
/*!
ensures
- returns the top element of the stack.
!*/
size_t
size
(
)
const
;
/*!
ensures
- returns the number of elements in this stack. In particular, the
number
returned is always N.
!*/
const
sstack
<
T
,
N
-
1
>&
pop
(
)
const
;
/*!
requires
- size() > 1
ensures
- returns a reference to the sub-stack S such that:
- S.size() == size()-1.
- S.top() is the next element in the stack.
!*/
sstack
<
T
,
N
-
1
>&
pop
(
);
/*!
requires
- size() > 1
ensures
- returns a reference to the sub-stack S such that:
- S.size() == size()-1.
- S.top() is the next element in the stack.
!*/
public
:
typedef
T
value_type
;
const
static
size_t
num_elements
=
N
;
sstack
(
);
/*!
ensures
- #size() == N
- All elements of this stack are default constructed.
!*/
sstack
(
const
T
&
item
);
/*!
ensures
- #size() == N
- Initializes all N elements in this stack with the given item. E.g
.
top()==item, pop().top()==item, pop().pop().top()==item, etc.
!*/
const
T
&
top
(
)
const
;
/*!
ensures
- returns the top element of the stack.
!*/
T
&
top
(
);
/*!
ensures
- returns the top element of the stack.
!*/
size_t
size
(
)
const
;
/*!
ensures
- returns the number of elements in this stack. In particular, the number
returned is always N.
!*/
const
sstack
<
T
,
N
-
1
>&
pop
(
)
const
;
/*!
requires
- size() > 1
ensures
- returns a reference to the sub-stack S such that:
- S.size() == size()-1.
- S.top() is the next element in the stack.
!*/
sstack
<
T
,
N
-
1
>&
pop
(
);
/*!
requires
- size() > 1
ensures
- returns a reference to the sub-stack S such that:
- S.size() == size()-1.
- S.top() is the next element in the stack.
!*/
};
// ----------------------------------------------------------------------------------------
...
...
dlib/dnn/input_abstract.h
View file @
7f7ddcaa
...
...
@@ -44,10 +44,10 @@ namespace dlib
ensures
- Constructs this object from item. This form of constructor is optional
but it allows you to provide a conversion from one input layer type to
another. For example, the following code is valid only if my_input2 can
be constructed from my_input1:
relu<fc<relu<fc<my_input1>>>> my_dnn1;
relu<fc<relu<fc<my_input2>>>> my_dnn2(my_dnn1);
another. For example, the following code is valid only if my_input
_layer
2 can
be constructed from my_input
_layer
1:
relu<fc<relu<fc<my_input
_layer
1>>>> my_dnn1;
relu<fc<relu<fc<my_input
_layer
2>>>> my_dnn2(my_dnn1);
This kind of pattern is useful if you want to use one type of input layer
during training but a different type of layer during testing since it
allows you to easily convert between related deep neural network types.
...
...
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