Submodule containing implementations for extended diffstruc array operations
Get partial derivative with respect to left operand
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(inout) | :: | this | |||
| type(array_type), | intent(in) | :: | upstream_grad |
Get partial derivative with respect to bias operand
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(inout) | :: | this | |||
| type(array_type), | intent(in) | :: | upstream_grad |
Get partial derivative of piecewise activation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(inout) | :: | this | |||
| type(array_type), | intent(in) | :: | upstream_grad |
Get partial derivative of softmax activation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(inout) | :: | this | |||
| type(array_type), | intent(in) | :: | upstream_grad |
Get partial derivative of softmax reverse operation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(inout) | :: | this | |||
| type(array_type), | intent(in) | :: | upstream_grad |
Get partial derivative of softmax reverse operation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(inout) | :: | this | |||
| type(array_type), | intent(in) | :: | upstream_grad |
Get partial derivative of swish activation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(inout) | :: | this | |||
| type(array_type), | intent(in) | :: | upstream_grad |
Softmax function for reverse mode autodiff
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in), | target | :: | softmax | ||
| class(array_type), | intent(in), | target | :: | gradient | ||
| integer, | intent(in) | :: | dim |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in) | :: | this | |||
| real(kind=real32), | intent(in), | dimension(:,:) | :: | upstream_grad | ||
| real(kind=real32), | intent(out), | dimension(:,:) | :: | output |
Get partial derivative with respect to left operand
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in) | :: | this | |||
| real(kind=real32), | intent(in), | dimension(:,:) | :: | upstream_grad | ||
| real(kind=real32), | intent(out), | dimension(:,:) | :: | output |
Get partial derivative of piecewise activation (in-place version)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in) | :: | this | |||
| real(kind=real32), | intent(in), | dimension(:,:) | :: | upstream_grad | ||
| real(kind=real32), | intent(out), | dimension(:,:) | :: | output |
Get partial derivative of softmax reverse operation (in-place version)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in) | :: | this | |||
| real(kind=real32), | intent(in), | dimension(:,:) | :: | upstream_grad | ||
| real(kind=real32), | intent(out), | dimension(:,:) | :: | output |
Get partial derivative of softmax reverse operation (in-place version)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in) | :: | this | |||
| real(kind=real32), | intent(in), | dimension(:,:) | :: | upstream_grad | ||
| real(kind=real32), | intent(out), | dimension(:,:) | :: | output |
Get partial derivative of softmax activation (in-place version)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in) | :: | this | |||
| real(kind=real32), | intent(in), | dimension(:,:) | :: | upstream_grad | ||
| real(kind=real32), | intent(out), | dimension(:,:) | :: | output |
Get partial derivative of softmax activation (in-place version, summed over samples)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in) | :: | this | |||
| real(kind=real32), | intent(in), | dimension(:,:) | :: | upstream_grad | ||
| real(kind=real32), | intent(out), | dimension(:) | :: | output |
Get partial derivative of swish activation (in-place version)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in) | :: | this | |||
| real(kind=real32), | intent(in), | dimension(:,:) | :: | upstream_grad | ||
| real(kind=real32), | intent(out), | dimension(:,:) | :: | output |
Add two autodiff arrays
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(array_ptr_type), | intent(in), | dimension(:) | :: | a | ||
| integer, | intent(in) | :: | idx1 | |||
| integer, | intent(in) | :: | idx2 |
Add bias to input array along specified dimension
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in), | target | :: | input | ||
| class(array_type), | intent(in), | target | :: | bias | ||
| integer, | intent(in) | :: | dim | |||
| logical, | intent(in), | optional | :: | dim_act_on_shape |
Concatenate two autodiff arrays along a specified dimension
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(array_ptr_type), | intent(in), | dimension(:) | :: | a | ||
| integer, | intent(in) | :: | idx1 | |||
| integer, | intent(in) | :: | idx2 | |||
| integer, | intent(in) | :: | dim |
Apply piecewise activation function to input array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in), | target | :: | input | ||
| real(kind=real32), | intent(in) | :: | gradient | |||
| real(kind=real32), | intent(in) | :: | limit |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in), | target | :: | input | ||
| integer, | intent(in) | :: | dim |
Swish activation function
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in), | target | :: | input | ||
| real(kind=real32), | intent(in) | :: | beta |