MCPcopy Create free account
hub / github.com/davisking/dlib / sigmoid_gradient

Function sigmoid_gradient

dlib/cuda/cudnn_dlibapi.cpp:1893–1919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1891 }
1892
1893 void sigmoid_gradient (
1894 tensor& grad,
1895 const tensor& dest,
1896 const tensor& gradient_input
1897 )
1898 {
1899 DLIB_CASSERT(
1900 have_same_dimensions(dest,gradient_input) == true &&
1901 have_same_dimensions(dest,grad) == true );
1902 if (dest.size() == 0)
1903 return;
1904
1905 const float alpha = 1;
1906 const float beta = is_same_object(grad,gradient_input) ? 0 : 1;
1907 CHECK_CUDNN(cudnnActivationBackward(context(),
1908 sigmoid_activation_descriptor(),
1909 &alpha,
1910 descriptor(dest),
1911 dest.device(),
1912 descriptor(gradient_input),
1913 gradient_input.device(),
1914 descriptor(dest),
1915 dest.device(),
1916 &beta,
1917 descriptor(grad),
1918 grad.device()));
1919 }
1920
1921 // ------------------------------------------------------------------------------------
1922

Callers

nothing calls this directly

Calls 7

descriptorFunction · 0.85
have_same_dimensionsFunction · 0.70
contextFunction · 0.70
is_same_objectFunction · 0.50
sizeMethod · 0.45
deviceMethod · 0.45

Tested by

no test coverage detected