API¶
Piecewise Linear Function¶
- class td3a_cpp_deep.fcts.piecewise_linear.PiecewiseLinearFunction(*args, **kwargs)[source]¶
Implements a function similar to a piecewise linear function. It multiplies by different coefficient on negative and positive number. It takes a tensor of shape (N, 1).
- class td3a_cpp_deep.fcts.piecewise_linear.PiecewiseLinearFunctionC(*args, **kwargs)[source]¶
Same function as
PiecewiseLinearFunction
but the implementation of forward and backward functions are done in C. Seepiecewise_linear_forward
andpiecewise_linear_backward
. It follows the tutorial Custom C++ and Cuda Extensions.