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
6539ea67
Commit
6539ea67
authored
Nov 08, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added prototypes for batch normalization's gradients.
parent
51ebcfc7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
1 deletion
+46
-1
cuda_dlib.h
dlib/dnn/cuda_dlib.h
+46
-1
No files found.
dlib/dnn/cuda_dlib.h
View file @
6539ea67
...
...
@@ -52,7 +52,6 @@ namespace dlib
// -----------------------------------------------------------------------------------
// TODO, add versions of batch_normalize() that output the gradients.
void
batch_normalize
(
resizable_tensor
&
dest
,
resizable_tensor
&
means
,
...
...
@@ -63,6 +62,7 @@ namespace dlib
);
/*!
requires
- src.num_samples() > 1
- gamma.num_samples() == 1
- beta.num_samples() == 1
- gamma.nr() == beta.nr() == src.nr()
...
...
@@ -80,6 +80,39 @@ namespace dlib
- #vars == the variance values of the contents of src.
!*/
void
batch_normalize_gradient
(
const
tensor
&
gradient_input
,
const
tensor
&
means
,
const
tensor
&
vars
,
const
tensor
&
src
,
const
tensor
&
gamma
,
tensor
&
src_grad
,
tensor
&
gamma_grad
,
tensor
&
beta_grad
);
/*!
requires
- vars and means should be the output of a call to
batch_normalize(dest,means,vars,src,gamma,beta)
- have_same_dimensions(gradient_input, src) == true
- have_same_dimensions(src, src_grad) == true
- src.num_samples() > 1
- gamma.num_samples() == 1
- have_same_dimensions(gamma, gamma_grad) == true
- have_same_dimensions(gamma, beta_grad) == true
- gamma.nr() == src.nr()
- gamma.nc() == src.nc()
- gamma.k() == src.k()
- have_same_dimensions(means, gamma) == true
- have_same_dimensions(vars, gamma) == true
ensures
- Let f(src,gamma,beta) == dot(gradient_input, dest output of
batch_normalize(dest,means,vars,src,gamma,beta))
- Adds the gradient of f() with respect to src to #src
- Adds the gradient of f() with respect to gamma to #gamma
- Adds the gradient of f() with respect to beta to #beta
!*/
void
batch_normalize_conv
(
resizable_tensor
&
dest
,
resizable_tensor
&
means
,
...
...
@@ -90,6 +123,7 @@ namespace dlib
);
/*!
requires
- src.num_samples() > 1
- gamma.num_samples()==gamma.nr()==gamma.nc() == 1
- beta.num_samples() ==beta.nr() ==gamma.nc() == 1
- gamma.k() == beta.k() == src.k()
...
...
@@ -103,6 +137,17 @@ namespace dlib
- #vars == the variance values of the contents of src.
!*/
void
batch_normalize_conv_gradient
(
const
tensor
&
gradient_input
,
const
tensor
&
means
,
const
tensor
&
vars
,
const
tensor
&
src
,
const
tensor
&
gamma
,
tensor
&
src_grad
,
tensor
&
gamma_grad
,
tensor
&
beta_grad
);
// -----------------------------------------------------------------------------------
class
dropout
...
...
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