| ggml_rwkv_wkv6_back | R Documentation |
Gradients of ggml_rwkv_wkv6 with respect to all six of its
inputs, given grad, the gradient of the loss with respect to the
recurrence's packed forward result.
ggml_rwkv_wkv6_back(ctx, k, v, r, tf, td, state, grad)
ctx |
GGML context |
k, v, r, tf, td, state |
The tensors passed to the forward recurrence |
grad |
Gradient w.r.t. the packed forward result |
Training reaches this automatically through the backward graph; it is exported so the gradient can be checked against a numeric one.
A flat tensor holding the six gradients, concatenated
All six gradients come back in one flat tensor, in the order the forward op
takes its inputs: [d_k | d_v | d_r | d_tf | d_td | d_state].
ggml_rwkv_wkv6
Other state-space:
ggml_gated_linear_attn(),
ggml_gated_linear_attn_back(),
ggml_rwkv_output(),
ggml_rwkv_wkv6(),
ggml_rwkv_wkv7(),
ggml_rwkv_wkv7_back(),
ggml_ssm_conv(),
ggml_ssm_conv_back(),
ggml_ssm_scan(),
ggml_ssm_scan_back(),
ggml_ssm_scan_output()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.