@@ -263,13 +263,10 @@ fit_glmpca_pois <- function(
263
263
264
264
update_indices_f <- sort(setdiff(1 : K ,fixed_f ))
265
265
266
- FF_to_update <- FF_test
267
- # browser()
268
-
269
266
# now, I just need to project the results back
270
267
update_factors_faster_parallel(
271
268
L_T = t(res $ fit $ LL ),
272
- FF = FF_to_update ,
269
+ FF = FF_test ,
273
270
M = as.matrix(res $ fit $ LL [update_indices_f ,,drop = FALSE ] %*% Y_test ),
274
271
update_indices = update_indices_f - 1 ,
275
272
num_iter = 1000 ,
@@ -280,7 +277,7 @@ fit_glmpca_pois <- function(
280
277
281
278
# now, I need to reconstruct FF, and hopefully compute the log-likelihood
282
279
FF [, train_idx ] <- res $ fit $ FF
283
- FF [, test_idx ] <- FF_to_update
280
+ FF [, test_idx ] <- FF_test
284
281
res $ fit $ FF <- FF
285
282
286
283
if (inherits(Y ," sparseMatrix" )) {
@@ -291,7 +288,7 @@ fit_glmpca_pois <- function(
291
288
loglik_func <- lik_glmpca_pois_log
292
289
}
293
290
294
- test_loglik <- loglik_func(Y_test ,res $ fit $ LL ,FF_to_update ,test_loglik_const )
291
+ test_loglik <- loglik_func(Y_test ,res $ fit $ LL ,FF_test ,test_loglik_const )
295
292
res $ loglik <- res $ loglik + test_loglik
296
293
297
294
}
0 commit comments