Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ categorical_logit_glm()

__kernel void stan::math::opencl_kernels::categorical_logit_glm ( __global double *  logp_global,
__global double *  exp_lin_global,
__global double *  inv_sum_exp_lin_global,
__global double *  neg_softmax_lin_global,
__global double *  alpha_derivative,
const __global int *  y_global,
const __global double *  x_beta_global,
const __global double *  alpha_global,
const int  N_instances,
const int  N_attributes,
const int  N_classes,
const int  is_y_vector,
const int  need_alpha_derivative,
const int  need_neg_softmax_lin_global 
)

GPU implementation of Generalized Linear Model (GLM) with categorical distribution and logit (softmax) link function.

Must be run with at least N threads and local size equal to LOCAL_SIZE_.

Parameters
[out]logp_globalpartially summed log probability (1 value per work group)
[out]exp_lin_globalexponentiation of sum of alpha and matrix product of x and beta
[out]inv_sum_exp_lin_globalinverse of rowwise sum of exp_lin_global
[out]neg_softmax_lin_globalnegated softmax of sum of alpha and matrix product of x and beta
[out]alpha_derivativederivative wrt alpha
[in]y_globala scalar or vector of classes.
[in]x_beta_globalproduct of design matrix and weight matrix
[in]alpha_globalintercept (in log odds)
N_instancesnumber of instances
N_attributesnumber of attributes
N_classesnumber of classes
is_y_vector0 or 1 - whether y is a vector (alternatively it is a scalar)
need_alpha_derivativeinterpreted as boolean - whether alpha_derivative needs to be computed
need_neg_softmax_lin_globalinterpreted as boolean - whether neg_softmax_lin_global needs to be computed

Definition at line 42 of file categorical_logit_glm_lpmf.hpp.