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
dbe14b7f
Commit
dbe14b7f
authored
Nov 24, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added uniform_random_hash() and gaussian_random_hash().
parent
0f419e18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
0 deletions
+59
-0
random_hashing.h
dlib/general_hash/random_hashing.h
+0
-0
random_hashing_abstract.h
dlib/general_hash/random_hashing_abstract.h
+58
-0
hash.h
dlib/hash.h
+1
-0
No files found.
dlib/general_hash/random_hashing.h
0 → 100644
View file @
dbe14b7f
This diff is collapsed.
Click to expand it.
dlib/general_hash/random_hashing_abstract.h
0 → 100644
View file @
dbe14b7f
// Copyright (C) 2012 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_RANDOM_HAsHING_ABSTRACT_H__
#ifdef DLIB_RANDOM_HAsHING_ABSTRACT_H__
#include "random_hashing_abstract.h"
#include "murmur_hash3.h"
namespace
dlib
{
// ----------------------------------------------------------------------------------------
double
uniform_random_hash
(
const
uint64
&
k1
,
const
uint64
&
k2
,
const
uint64
&
k3
);
/*!
ensures
- This function uses hashing to generate uniform random values in the range [0,1).
- To define this function precisely, assume we have an arbitrary sequence of
input triplets. Then calling uniform_random_hash() on each of them should
result in a sequence of double values that look like numbers sampled
independently and uniformly at random from the interval [0,1). This is true
even if there is some simple pattern in the inputs. For example, (0,0,0),
(1,0,0), (2,0,0), (3,0,0), etc.
- This function is deterministic. That is, the same output is always returned
when given the same input.
!*/
// ----------------------------------------------------------------------------------------
double
gaussian_random_hash
(
const
uint64
&
k1
,
const
uint64
&
k2
,
const
uint64
&
k3
);
/*!
ensures
- This function uses hashing to generate Gaussian distributed random values
with mean 0 and variance 1.
- To define this function precisely, assume we have an arbitrary sequence of
input triplets. Then calling gaussian_random_hash() on each of them should
result in a sequence of double values that look like numbers sampled
independently from a standard normal distribution. This is true even if
there is some simple pattern in the inputs. For example, (0,0,0), (1,0,0),
(2,0,0), (3,0,0), etc.
- This function is deterministic. That is, the same output is always returned
when given the same input.
!*/
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_RANDOM_HAsHING_ABSTRACT_H__
dlib/hash.h
View file @
dbe14b7f
...
...
@@ -5,6 +5,7 @@
#include "general_hash/hash.h"
#include "general_hash/random_hashing.h"
#endif // DLIB_HASh_
...
...
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