Commit 269a3ed1 authored by Davis King's avatar Davis King
Browse files

fix incorrect docs about what gradient is computed

parent 92106718
...@@ -1639,18 +1639,19 @@ namespace dlib { namespace tt ...@@ -1639,18 +1639,19 @@ namespace dlib { namespace tt
void gelu_gradient ( void gelu_gradient (
tensor& grad, tensor& grad,
const tensor& dest, const tensor& src,
const tensor& gradient_input const tensor& gradient_input
); );
/*! /*!
requires requires
- have_same_dimensions(dest,gradient_input) == true - have_same_dimensions(src,gradient_input) == true
- have_same_dimensions(dest,grad) == true - have_same_dimensions(src,grad) == true
ensures ensures
- This function computes the gradient of f() with respect to SRC and stores - Recalling that dest is the output of gelu(dest,src), let f(src) ==
it to grad. Moreover, if is_same_object(grad,gradient_input)==true then dot(gradient_input,dest). Then this function computes the gradient of f() with respect
the output is assigned to grad, replacing its previous contents. to src and stores it to grad. Moreover, if is_same_object(grad,gradient_input)==true
Otherwise the output is added to grad. 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 - This function supports in-place operation, i.e. having
is_same_object(grad, gradient_input)==true is_same_object(grad, gradient_input)==true
!*/ !*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment