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
269a3ed1
"vscode:/vscode.git/clone" did not exist on "5d9444307f5ccff5fdc15b7b1ed3eaf526c0917e"
Commit
269a3ed1
authored
Apr 13, 2021
by
Davis King
Browse files
fix incorrect docs about what gradient is computed
parent
92106718
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
dlib/cuda/tensor_tools.h
dlib/cuda/tensor_tools.h
+9
-8
No files found.
dlib/cuda/tensor_tools.h
View file @
269a3ed1
...
...
@@ -1639,18 +1639,19 @@ namespace dlib { namespace tt
void
gelu_gradient
(
tensor
&
grad
,
const
tensor
&
dest
,
const
tensor
&
src
,
const
tensor
&
gradient_input
);
/*!
requires
- have_same_dimensions(
dest
,gradient_input) == true
- have_same_dimensions(
dest
,grad) == true
- have_same_dimensions(
src
,gradient_input) == true
- have_same_dimensions(
src
,grad) == true
ensures
- This function computes the gradient of f() with respect to SRC and stores
it to grad. Moreover, if is_same_object(grad,gradient_input)==true then
the output is assigned to grad, replacing its previous contents.
Otherwise the output is added to grad.
- Recalling that dest is the output of gelu(dest,src), let f(src) ==
dot(gradient_input,dest). Then this function computes the gradient of f() with respect
to src and stores it to grad. Moreover, if is_same_object(grad,gradient_input)==true
then the output is assigned to grad, replacing its previous contents. Otherwise the
output is added to grad.
- This function supports in-place operation, i.e. having
is_same_object(grad, gradient_input)==true
!*/
...
...
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