From 850459304228651612e117029c16c1f16cf68195 Mon Sep 17 00:00:00 2001 From: Kieran Campbell Date: Mon, 6 Apr 2020 15:38:35 -0400 Subject: [PATCH] Beta now initialized based on genes --- R/inference-tensorflow.R | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/R/inference-tensorflow.R b/R/inference-tensorflow.R index b19f7e6..c93732d 100644 --- a/R/inference-tensorflow.R +++ b/R/inference-tensorflow.R @@ -91,11 +91,17 @@ inference_tensorflow <- function(Y, tf$constant(Inf, dtype = tf$float64)) }) - beta <- tf$Variable(tf$random_normal(shape(G,P), - mean = 0, - stddev = 1, - seed = random_seed, - dtype = tf$float64), + # beta <- tf$Variable(tf$random_normal(shape(G,P), + # mean = 0, + # stddev = 1, + # seed = random_seed, + # dtype = tf$float64), + # dtype = tf$float64) + + beta_0_init <- scale(colMeans(Y)) + beta_init <- cbind(beta_0_init, + matrix(0, nrow = G, ncol = P-1)) + beta <- tf$Variable(tf$constant(beta_init, dtype = tf$float64), dtype = tf$float64) theta_logit <- tf$Variable(tf$random_normal(shape(C),