File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -158,12 +158,16 @@ randomizedLasso = function(X,
158
158
return (- Inf )
159
159
}
160
160
161
- A = opt_transform $ linear_term %*% opt_state + observed_raw + opt_transform $ offset_term
162
- D = - apply(A ^ 2 , 2 , sum ) / noise_scale ^ 2
163
- # D = log_density_gaussian_conditional_(noise_scale,
164
- # opt_transform$linear_term,
165
- # as.matrix(opt_state),
166
- # observed_raw + opt_transform$offset_term)
161
+ use_C_code = TRUE
162
+ if (! use_C_code ) {
163
+ A = opt_transform $ linear_term %*% opt_state + observed_raw + opt_transform $ offset_term
164
+ D = - apply(A ^ 2 , 2 , sum ) / noise_scale ^ 2
165
+ } else {
166
+ D = log_density_gaussian_conditional_(noise_scale ,
167
+ opt_transform $ linear_term ,
168
+ as.matrix(opt_state ),
169
+ observed_raw + opt_transform $ offset_term )
170
+ }
167
171
return (D )
168
172
}
169
173
You can’t perform that action at this time.
0 commit comments