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
9540ca23
Commit
9540ca23
authored
Aug 03, 2017
by
Davis King
Browse files
Added operator<< for the DNN solvers.
parent
aafde206
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
dlib/dnn/solvers.h
dlib/dnn/solvers.h
+12
-0
dlib/dnn/solvers_abstract.h
dlib/dnn/solvers_abstract.h
+15
-0
No files found.
dlib/dnn/solvers.h
View file @
9540ca23
...
@@ -119,6 +119,12 @@ namespace dlib
...
@@ -119,6 +119,12 @@ namespace dlib
deserialize
(
item
.
momentum
,
in
);
deserialize
(
item
.
momentum
,
in
);
}
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
sgd
&
item
)
{
out
<<
"sgd: weight_decay="
<<
item
.
get_weight_decay
()
<<
", momentum="
<<
item
.
get_momentum
();
return
out
;
}
private:
private:
template
<
typename
layer_type
>
template
<
typename
layer_type
>
...
@@ -294,6 +300,12 @@ namespace dlib
...
@@ -294,6 +300,12 @@ namespace dlib
deserialize
(
item
.
t
,
in
);
deserialize
(
item
.
t
,
in
);
}
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
adam
&
item
)
{
out
<<
"adam: weight_decay="
<<
item
.
get_weight_decay
()
<<
", momentum1="
<<
item
.
get_momentum1
()
<<
", momentum2="
<<
item
.
get_momentum2
();
return
out
;
}
private:
private:
template
<
typename
layer_type
>
template
<
typename
layer_type
>
...
...
dlib/dnn/solvers_abstract.h
View file @
9540ca23
...
@@ -64,6 +64,11 @@ namespace dlib
...
@@ -64,6 +64,11 @@ namespace dlib
provides serialization support
provides serialization support
!*/
!*/
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
EXAMPLE_SOLVER
&
item
);
/*!
Prints the solver's name and parameters to out.
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
@@ -121,6 +126,11 @@ namespace dlib
...
@@ -121,6 +126,11 @@ namespace dlib
provides serialization support
provides serialization support
!*/
!*/
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
sgd
&
item
);
/*!
Prints the solver's name and parameters to out.
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
class
adam
class
adam
...
@@ -181,6 +191,11 @@ namespace dlib
...
@@ -181,6 +191,11 @@ namespace dlib
provides serialization support
provides serialization support
!*/
!*/
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
adam
&
item
);
/*!
Prints the solver's name and parameters to out.
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
}
}
...
...
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