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
f47620c1
"git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "d2f192f814d81e9bf6a6e6ff4c8098e5e62e8126"
Commit
f47620c1
authored
Jan 08, 2016
by
Davis King
Browse files
merged
parents
f4f8e4db
ab2cd129
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
dlib/statistics/running_gradient.h
dlib/statistics/running_gradient.h
+23
-0
dlib/statistics/running_gradient_abstract.h
dlib/statistics/running_gradient_abstract.h
+16
-0
No files found.
dlib/statistics/running_gradient.h
View file @
f47620c1
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
#include "running_gradient_abstract.h"
#include "running_gradient_abstract.h"
#include "../algs.h"
#include "../algs.h"
#include "../serialize.h"
#include <cmath>
#include <cmath>
#include "../matrix.h"
#include "../matrix.h"
...
@@ -115,6 +116,28 @@ namespace dlib
...
@@ -115,6 +116,28 @@ namespace dlib
return
1
-
probability_gradient_less_than
(
thresh
);
return
1
-
probability_gradient_less_than
(
thresh
);
}
}
friend
void
serialize
(
const
running_gradient
&
item
,
std
::
ostream
&
out
)
{
int
version
=
1
;
serialize
(
version
,
out
);
serialize
(
item
.
n
,
out
);
serialize
(
item
.
R
,
out
);
serialize
(
item
.
w
,
out
);
serialize
(
item
.
residual_squared
,
out
);
}
friend
void
deserialize
(
running_gradient
&
item
,
std
::
ostream
&
in
)
{
int
version
=
0
;
deserialize
(
version
,
in
);
if
(
version
!=
1
)
throw
serialization_error
(
"Unexpected version found while deserializing dlib::running_gradient."
);
deserialize
(
item
.
n
,
in
);
deserialize
(
item
.
R
,
in
);
deserialize
(
item
.
w
,
in
);
deserialize
(
item
.
residual_squared
,
in
);
}
private:
private:
static
double
normal_cfd
(
double
value
,
double
mean
,
double
stddev
)
static
double
normal_cfd
(
double
value
,
double
mean
,
double
stddev
)
...
...
dlib/statistics/running_gradient_abstract.h
View file @
f47620c1
...
@@ -100,6 +100,22 @@ namespace dlib
...
@@ -100,6 +100,22 @@ namespace dlib
!*/
!*/
};
};
void
serialize
(
const
running_gradient
&
item
,
std
::
ostream
&
out
);
/*!
provides serialization support
!*/
void
deserialize
(
running_gradient
&
item
,
std
::
istream
&
in
);
/*!
provides serialization support
!*/
}
}
#endif // DLIB_RuNNING_GRADIENT_ABSTRACT_Hh_
#endif // DLIB_RuNNING_GRADIENT_ABSTRACT_Hh_
...
...
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