Skip to content

Commit

Permalink
commenting out check functions causing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mtwesley committed Nov 25, 2024
1 parent 35bc184 commit 4874193
Showing 1 changed file with 62 additions and 62 deletions.
124 changes: 62 additions & 62 deletions R/censored.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ distrib <- greta:::.internals$nodes$constructors$distrib
distribution_node <- greta:::.internals$nodes$node_classes$distribution_node
as.greta_array <- greta:::.internals$greta_arrays$as.greta_array

check_dims <- greta:::.internals$checks$check_dims
check_numeric_length_1 <- greta:::.internals$checks$check_numeric_length_1
check_finite <- greta:::.internals$checks$check_finite
check_x_gte_y <- greta:::.internals$checks$check_x_gte_y
check_param_greta_array <- greta:::.internals$checks$check_param_greta_array
# check_dims <- greta:::.internals$checks$check_dims
# check_numeric_length_1 <- greta:::.internals$checks$check_numeric_length_1
# check_finite <- greta:::.internals$checks$check_finite
# check_x_gte_y <- greta:::.internals$checks$check_x_gte_y
# check_param_greta_array <- greta:::.internals$checks$check_param_greta_array

tfp <- import("tensorflow_probability")
tf <- import("tensorflow")
Expand All @@ -20,14 +20,14 @@ normal_censored_distribution <- R6::R6Class(
initialize = function(mean, sd, is_censored, censoring_type, lower, upper, dim) {
mean <- as.greta_array(mean)
sd <- as.greta_array(sd)
is_censored <- check_param_greta_array(is_censored)
check_numeric_length_1(lower)
check_numeric_length_1(upper)
check_finite(lower)
check_finite(upper)
check_x_gte_y(lower, upper)
# is_censored <- check_param_greta_array(is_censored)
# check_numeric_length_1(lower)
# check_numeric_length_1(upper)
# check_finite(lower)
# check_finite(upper)
# check_x_gte_y(lower, upper)

dim <- check_dims(mean, sd, is_censored, target_dim = dim)
# dim <- check_dims(mean, sd, is_censored, target_dim = dim)

super$initialize("normal_censored", dim)
self$add_parameter(mean, "mean")
Expand Down Expand Up @@ -74,14 +74,14 @@ lognormal_censored_distribution <- R6::R6Class(
initialize = function(meanlog, sdlog, is_censored, censoring_type, lower, upper, dim) {
meanlog <- as.greta_array(meanlog)
sdlog <- as.greta_array(sdlog)
is_censored <- check_param_greta_array(is_censored)
check_numeric_length_1(lower)
check_numeric_length_1(upper)
check_finite(lower)
check_finite(upper)
check_x_gte_y(lower, upper)
# is_censored <- check_param_greta_array(is_censored)
# check_numeric_length_1(lower)
# check_numeric_length_1(upper)
# check_finite(lower)
# check_finite(upper)
# check_x_gte_y(lower, upper)

dim <- check_dims(meanlog, sdlog, is_censored, target_dim = dim)
# dim <- check_dims(meanlog, sdlog, is_censored, target_dim = dim)

super$initialize("lognormal_censored", dim)
self$add_parameter(meanlog, "meanlog")
Expand Down Expand Up @@ -129,14 +129,14 @@ student_censored_distribution <- R6::R6Class(
df <- as.greta_array(df)
loc <- as.greta_array(loc)
scale <- as.greta_array(scale)
is_censored <- check_param_greta_array(is_censored)
check_numeric_length_1(lower)
check_numeric_length_1(upper)
check_finite(lower)
check_finite(upper)
check_x_gte_y(lower, upper)
# is_censored <- check_param_greta_array(is_censored)
# check_numeric_length_1(lower)
# check_numeric_length_1(upper)
# check_finite(lower)
# check_finite(upper)
# check_x_gte_y(lower, upper)

dim <- check_dims(df, loc, scale, is_censored, target_dim = dim)
# dim <- check_dims(df, loc, scale, is_censored, target_dim = dim)

super$initialize("student_censored", dim)
self$add_parameter(df, "df")
Expand Down Expand Up @@ -185,14 +185,14 @@ gamma_censored_distribution <- R6::R6Class(
initialize = function(shape, rate, is_censored, censoring_type, lower, upper, dim) {
shape <- as.greta_array(shape)
rate <- as.greta_array(rate)
is_censored <- check_param_greta_array(is_censored)
check_numeric_length_1(lower)
check_numeric_length_1(upper)
check_finite(lower)
check_finite(upper)
check_x_gte_y(lower, upper)
# is_censored <- check_param_greta_array(is_censored)
# check_numeric_length_1(lower)
# check_numeric_length_1(upper)
# check_finite(lower)
# check_finite(upper)
# check_x_gte_y(lower, upper)

dim <- check_dims(shape, rate, is_censored, target_dim = dim)
# dim <- check_dims(shape, rate, is_censored, target_dim = dim)

super$initialize("gamma_censored", dim)
self$add_parameter(shape, "shape")
Expand Down Expand Up @@ -238,14 +238,14 @@ exponential_censored_distribution <- R6::R6Class(
public = list(
initialize = function(rate, is_censored, censoring_type, lower, upper, dim) {
rate <- as.greta_array(rate)
is_censored <- check_param_greta_array(is_censored)
check_numeric_length_1(lower)
check_numeric_length_1(upper)
check_finite(lower)
check_finite(upper)
check_x_gte_y(lower, upper)
# is_censored <- check_param_greta_array(is_censored)
# check_numeric_length_1(lower)
# check_numeric_length_1(upper)
# check_finite(lower)
# check_finite(upper)
# check_x_gte_y(lower, upper)

dim <- check_dims(rate, is_censored, target_dim = dim)
# dim <- check_dims(rate, is_censored, target_dim = dim)

super$initialize("exponential_censored", dim)
self$add_parameter(rate, "rate")
Expand Down Expand Up @@ -289,14 +289,14 @@ weibull_censored_distribution <- R6::R6Class(
initialize = function(shape, scale, is_censored, censoring_type, lower, upper, dim) {
shape <- as.greta_array(shape)
scale <- as.greta_array(scale)
is_censored <- check_param_greta_array(is_censored)
check_numeric_length_1(lower)
check_numeric_length_1(upper)
check_finite(lower)
check_finite(upper)
check_x_gte_y(lower, upper)
# is_censored <- check_param_greta_array(is_censored)
# check_numeric_length_1(lower)
# check_numeric_length_1(upper)
# check_finite(lower)
# check_finite(upper)
# check_x_gte_y(lower, upper)

dim <- check_dims(shape, scale, is_censored, target_dim = dim)
# dim <- check_dims(shape, scale, is_censored, target_dim = dim)

super$initialize("weibull_censored", dim)
self$add_parameter(shape, "shape")
Expand Down Expand Up @@ -343,14 +343,14 @@ pareto_censored_distribution <- R6::R6Class(
initialize = function(scale, alpha, is_censored, censoring_type, lower, upper, dim) {
scale <- as.greta_array(scale)
alpha <- as.greta_array(alpha)
is_censored <- check_param_greta_array(is_censored)
check_numeric_length_1(lower)
check_numeric_length_1(upper)
check_finite(lower)
check_finite(upper)
check_x_gte_y(lower, upper)
# is_censored <- check_param_greta_array(is_censored)
# check_numeric_length_1(lower)
# check_numeric_length_1(upper)
# check_finite(lower)
# check_finite(upper)
# check_x_gte_y(lower, upper)

dim <- check_dims(scale, alpha, is_censored, target_dim = dim)
# dim <- check_dims(scale, alpha, is_censored, target_dim = dim)

super$initialize("pareto_censored", dim)
self$add_parameter(scale, "scale")
Expand Down Expand Up @@ -397,14 +397,14 @@ beta_censored_distribution <- R6::R6Class(
initialize = function(alpha, beta, is_censored, censoring_type, lower, upper, dim) {
alpha <- as.greta_array(alpha)
beta <- as.greta_array(beta)
is_censored <- check_param_greta_array(is_censored)
check_numeric_length_1(lower)
check_numeric_length_1(upper)
check_finite(lower)
check_finite(upper)
check_x_gte_y(lower, upper)

dim <- check_dims(alpha, beta, is_censored, target_dim = dim)
# is_censored <- check_param_greta_array(is_censored)
# check_numeric_length_1(lower)
# check_numeric_length_1(upper)
# check_finite(lower)
# check_finite(upper)
# check_x_gte_y(lower, upper)

# dim <- check_dims(alpha, beta, is_censored, target_dim = dim)

super$initialize("beta_censored", dim)
self$add_parameter(alpha, "alpha")
Expand Down

0 comments on commit 4874193

Please sign in to comment.