Stan Math Library
4.9.0
Automatic Differentiation
|
__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_.
[out] | logp_global | partially summed log probability (1 value per work group) |
[out] | exp_lin_global | exponentiation of sum of alpha and matrix product of x and beta |
[out] | inv_sum_exp_lin_global | inverse of rowwise sum of exp_lin_global |
[out] | neg_softmax_lin_global | negated softmax of sum of alpha and matrix product of x and beta |
[out] | alpha_derivative | derivative wrt alpha |
[in] | y_global | a scalar or vector of classes. |
[in] | x_beta_global | product of design matrix and weight matrix |
[in] | alpha_global | intercept (in log odds) |
N_instances | number of instances | |
N_attributes | number of attributes | |
N_classes | number of classes | |
is_y_vector | 0 or 1 - whether y is a vector (alternatively it is a scalar) | |
need_alpha_derivative | interpreted as boolean - whether alpha_derivative needs to be computed | |
need_neg_softmax_lin_global | interpreted as boolean - whether neg_softmax_lin_global needs to be computed |
Definition at line 42 of file categorical_logit_glm_lpmf.hpp.