Skip to content

Instantly share code, notes, and snippets.

@njtierney
Last active May 10, 2024 03:49
Show Gist options
  • Save njtierney/6b8a5d6a8380f61570c6fffcf6a530b5 to your computer and use it in GitHub Desktop.
Save njtierney/6b8a5d6a8380f61570c6fffcf6a530b5 to your computer and use it in GitHub Desktop.
library(greta)
#> 
#> Attaching package: 'greta'
#> The following objects are masked from 'package:stats':
#> 
#>     binomial, cov2cor, poisson
#> The following objects are masked from 'package:base':
#> 
#>     %*%, apply, backsolve, beta, chol2inv, colMeans, colSums, diag,
#>     eigen, forwardsolve, gamma, identity, rowMeans, rowSums, sweep,
#>     tapply
x <- wishart(df = 4, Sigma = diag(3))
#> ℹ Initialising python and checking dependencies, this may take a moment.
#> ✔ Initialising python and checking dependencies ... done!
#> 
chol_x <- chol(x)
chol_x_p1 <- chol_x + 1

library(waldo)

x_node <- greta:::get_node(x)
chol_x_node <- greta:::get_node(chol_x)
chol_x_p1_node <- greta:::get_node(chol_x_p1)

compare(
  x = x_node,
  y = chol_x_node,
  x_arg = "wishart",
  y_arg = "chol_wishart",
  max_diffs = Inf
)
#>     class(wishart$children[[1]]) | class(chol_wishart$children[[1]])    
#> [1] "wishart_distribution"       - "operation_node"                  [1]
#> [2] "distribution_node"          -                                      
#> [3] "node"                       | "node"                            [2]
#> [4] "R6"                         | "R6"                              [3]
#> 
#> `wishart$children[[1]]` is length 48
#> `chol_wishart$children[[1]]` is length 33
#> 
#>      names(wishart$children[[1]])     | names(chol_wishart$children[[1]])     
#>  [1] ".value"                         | ".value"                          [1] 
#>                                       - "add_argument"                    [2] 
#>  [2] "add_child"                      | "add_child"                       [3] 
#>  [3] "add_parameter"                  -                                       
#>  [4] "add_parent"                     | "add_parent"                      [4] 
#>  [5] "add_target"                     - "arguments"                       [5] 
#>  [6] "bounds"                         -                                       
#>  [7] "child_names"                    | "child_names"                     [6] 
#>  [8] "children"                       | "children"                        [7] 
#>  [9] "clone"                          | "clone"                           [8] 
#> [10] "create_target"                  -                                       
#> [11] "define_tf"                      | "define_tf"                       [9] 
#> [12] "defined"                        | "defined"                         [10]
#> [13] "description"                    | "description"                     [11]
#> [14] "dim"                            | "dim"                             [12]
#> [15] "discrete"                       -                                       
#> [16] "distribution"                   | "distribution"                    [13]
#> [17] "distribution_name"              -                                       
#> [18] "expand_parameter"               -                                       
#> [19] "expand_parameters_to"           -                                       
#> [20] "get_tf_target_node"             -                                       
#> [21] "get_unique_name"                | "get_unique_name"                 [14]
#> [22] "initialize"                     | "initialize"                      [15]
#> [23] "list_children"                  | "list_children"                   [16]
#> [24] "list_parents"                   | "list_parents"                    [17]
#> [25] "multivariate"                   - "operation"                       [18]
#> [26] "parameter_shape_matches_output" - "operation_args"                  [19]
#> [27] "parameters"                     - "operation_name"                  [20]
#> [28] "parent_names"                   | "parent_names"                    [21]
#> [29] "parents"                        | "parents"                         [22]
#> [30] "plotting_label"                 | "plotting_label"                  [23]
#> 
#>      names(wishart$children[[1]]) | names(chol_wishart$children[[1]])     
#> [32] "register_family"            | "register_family"                 [25]
#> [33] "remove_child"               | "remove_child"                    [26]
#> [34] "remove_parent"              | "remove_parent"                   [27]
#> [35] "remove_target"              -                                       
#> [36] "representations"            | "representations"                 [28]
#> [37] "reset_target_flags"         -                                       
#> [38] "set_distribution"           | "set_distribution"                [29]
#> [39] "sigma_is_cholesky"          -                                       
#> [40] "target"                     -                                       
#> [41] "target_is_cholesky"         -                                       
#> [42] "tf"                         | "tf"                              [30]
#> [43] "tf_distrib"                 - "tf_function_env"                 [31]
#> [44] "truncatable"                -                                       
#> [45] "truncation"                 -                                       
#> [46] "unique_name"                | "unique_name"                     [32]
#> [47] "user_node"                  -                                       
#> [48] "value"                      | "value"                           [33]
#> 
#> `wishart$children[[1]]$.value` is an S3 object of class <unknowns/matrix/array>, a double vector
#> `chol_wishart$children[[1]]$.value` is a double vector (NA, NA, NA, NA, NA, ...)
#> 
#> `wishart$children[[1]]$add_parameter` is a function
#> `chol_wishart$children[[1]]$add_parameter` is absent
#> 
#> `wishart$children[[1]]$add_target` is a function
#> `chol_wishart$children[[1]]$add_target` is absent
#> 
#> `wishart$children[[1]]$bounds` is a double vector (-Inf, Inf)
#> `chol_wishart$children[[1]]$bounds` is absent
#> 
#> `wishart$children[[1]]$children` is length 0
#> `chol_wishart$children[[1]]$children` is length 1
#> 
#> `wishart$children[[1]]$children[[1]]` is absent
#> `chol_wishart$children[[1]]$children[[1]]` is an R6 object of class <operation_node/node>
#> 
#> `wishart$children[[1]]$create_target` is a function
#> `chol_wishart$children[[1]]$create_target` is absent
#> 
#> `wishart$children[[1]]$discrete` is a logical vector (FALSE)
#> `chol_wishart$children[[1]]$discrete` is absent
#> 
#> `wishart$children[[1]]$distribution_name` is a character vector ('wishart')
#> `chol_wishart$children[[1]]$distribution_name` is absent
#> 
#> `wishart$children[[1]]$expand_parameter` is a function
#> `chol_wishart$children[[1]]$expand_parameter` is absent
#> 
#> `wishart$children[[1]]$expand_parameters_to` is a function
#> `chol_wishart$children[[1]]$expand_parameters_to` is absent
#> 
#> `wishart$children[[1]]$get_tf_target_node` is a function
#> `chol_wishart$children[[1]]$get_tf_target_node` is absent
#> 
#> body(wishart$children[[1]]$initialize) vs body(chol_wishart$children[[1]]$initialize)
#>   `{`
#> - `    df <- as.greta_array(df)`
#> - `    sigma <- as.greta_array(Sigma)`
#> - `    check_sigma_square_2d_greta_array(sigma)`
#> - `    dim <- nrow(sigma)`
#> - `    super$initialize("wishart", dim(sigma), multivariate = TRUE)`
#> - `    if (has_representation(sigma, "cholesky")) {`
#> - `        sigma <- representation(sigma, "cholesky")`
#> - `        self$sigma_is_cholesky <- TRUE`
#> + `    dots <- lapply(list(...), as.greta_array)`
#> + `    if (is.null(dim)) {`
#> + `        dim_list <- lapply(dots, dim)`
#> + `        dim_lengths <- lengths(dim_list)`
#> + `        dim_list <- lapply(dim_list, pad_vector, to_length = max(dim_lengths))`
#> + `        dim <- do.call(pmax, dim_list)`
#>   `    }`
#> - `    self$add_parameter(df, "df", shape_matches_output = FALSE)`
#> - `    self$add_parameter(sigma, "sigma")`
#> - `    self$value(unknowns(dims = c(dim, dim), data = diag(dim)))`
#> + `    if (!identical(dim, c(1L, 1L)) & expand_scalars) {`
#> + `        dots <- lapply(dots, \`dim<-\`, dim)`
#> + `    }`
#> + `    for (greta_array in dots) {`
#> + `        self$add_argument(get_node(greta_array))`
#> + `    }`
#> + `    self$operation_name <- operation`
#> + `    self$operation <- tf_operation`
#> + `    self$operation_args <- operation_args`
#> + `    self$representations <- representations`
#> + `    self$tf_function_env <- tf_function_env`
#> + `    if (is.null(value)) {`
#> + `        value <- unknowns(dim = dim)`
#> + `    }`
#> + `    else if (!all.equal(dim(value), dim)) {`
#> + `        msg <- cli::format_error("values have the wrong dimension so cannot be used")`
#> + `        stop(msg, call. = FALSE)`
#> + `    }`
#> + `    super$initialize(dim, value)`
#>   `}`
#> 
#> `formals(wishart$children[[1]]$initialize)` is length 2
#> `formals(chol_wishart$children[[1]]$initialize)` is length 9
#> 
#> names(formals(wishart$children[[1]]$initialize)) vs names(formals(chol_wishart$children[[1]]$initialize))
#> - "df"
#> - "Sigma"
#> + "operation"
#> + "..."
#> + "dim"
#> + "operation_args"
#> + "tf_operation"
#> + "value"
#> + "representations"
#> + "tf_function_env"
#> + "expand_scalars"
#> 
#> `formals(wishart$children[[1]]$initialize)$dim` is absent
#> `formals(chol_wishart$children[[1]]$initialize)$dim` is NULL
#> 
#> `formals(wishart$children[[1]]$initialize)$operation_args` is absent
#> `formals(chol_wishart$children[[1]]$initialize)$operation_args` is a call
#> 
#> `formals(wishart$children[[1]]$initialize)$tf_operation` is absent
#> `formals(chol_wishart$children[[1]]$initialize)$tf_operation` is NULL
#> 
#> `formals(wishart$children[[1]]$initialize)$value` is absent
#> `formals(chol_wishart$children[[1]]$initialize)$value` is NULL
#> 
#> `formals(wishart$children[[1]]$initialize)$representations` is absent
#> `formals(chol_wishart$children[[1]]$initialize)$representations` is a call
#> 
#> `formals(wishart$children[[1]]$initialize)$tf_function_env` is absent
#> `formals(chol_wishart$children[[1]]$initialize)$tf_function_env` is a call
#> 
#> `formals(wishart$children[[1]]$initialize)$expand_scalars` is absent
#> `formals(chol_wishart$children[[1]]$initialize)$expand_scalars` is a logical vector (FALSE)
#> 
#> body(wishart$children[[1]]$list_children) vs body(chol_wishart$children[[1]]$list_children)
#>   `{`
#>   `    children <- self$children`
#>   `    mode <- dag$how_to_define(self)`
#> - `    if (mode == "sampling" & !is.null(self$target)) {`
#> - `        children <- c(children, list(self$target))`
#> + `    if (mode == "sampling" & has_distribution(self)) {`
#> + `        child_names <- vapply(children, member, "unique_name", `
#> + `            FUN.VALUE = character(1))`
#> + `        keep <- child_names != self$distribution$unique_name`
#> + `        children <- children[keep]`
#>   `    }`
#>   `    children`
#>   `}`
#> 
#> body(wishart$children[[1]]$list_parents) vs body(chol_wishart$children[[1]]$list_parents)
#>   `{`
#>   `    parents <- self$parents`
#>   `    mode <- dag$how_to_define(self)`
#> - `    if (mode == "sampling" & !is.null(self$target)) {`
#> - `        parent_names <- vapply(parents, member, "unique_name", `
#> - `            FUN.VALUE = character(1))`
#> - `        keep <- parent_names != self$target$unique_name`
#> - `        parents <- parents[keep]`
#> + `    if (mode == "sampling" & has_distribution(self)) {`
#> + `        parents <- c(parents, list(self$distribution))`
#>   `    }`
#>   `    parents`
#>   `}`
#> 
#> `wishart$children[[1]]$multivariate` is a logical vector (TRUE)
#> `chol_wishart$children[[1]]$multivariate` is absent
#> 
#> `wishart$children[[1]]$parameter_shape_matches_output` is a logical vector (FALSE, TRUE)
#> `chol_wishart$children[[1]]$parameter_shape_matches_output` is absent
#> 
#> `wishart$children[[1]]$parameters` is a list
#> `chol_wishart$children[[1]]$parameters` is absent
#> 
#> `wishart$children[[1]]$parents` is length 3
#> `chol_wishart$children[[1]]$parents` is length 1
#> 
#> `wishart$children[[1]]$parents[[2]]` is an R6 object of class <data_node/node>
#> `chol_wishart$children[[1]]$parents[[2]]` is absent
#> 
#> `wishart$children[[1]]$parents[[3]]` is an R6 object of class <data_node/node>
#> `chol_wishart$children[[1]]$parents[[3]]` is absent
#> 
#> `wishart$children[[1]]$remove_target` is a function
#> `chol_wishart$children[[1]]$remove_target` is absent
#> 
#> `wishart$children[[1]]$reset_target_flags` is a function
#> `chol_wishart$children[[1]]$reset_target_flags` is absent
#> 
#> `wishart$children[[1]]$sigma_is_cholesky` is a logical vector (FALSE)
#> `chol_wishart$children[[1]]$sigma_is_cholesky` is absent
#> 
#> `wishart$children[[1]]$target` is an R6 object of class <operation_node/node>
#> `chol_wishart$children[[1]]$target` is absent
#> 
#> `wishart$children[[1]]$target_is_cholesky` is a logical vector (FALSE)
#> `chol_wishart$children[[1]]$target_is_cholesky` is absent
#> 
#> body(wishart$children[[1]]$tf) vs body(chol_wishart$children[[1]]$tf)
#>   `{`
#> - `    assign(dag$tf_name(self), self$tf_distrib, envir = dag$tf_environment)`
#> + `    tfe <- dag$tf_environment`
#> + `    tf_name <- dag$tf_name(self)`
#> + `    mode <- dag$how_to_define(self)`
#> + `    if (mode == "sampling") {`
#> + `        tensor <- dag$draw_sample(self$distribution)`
#> + `        if (has_representation(self, "cholesky")) {`
#> + `            cli::cli_warn(message = c("When using {.fun calculate} to sample a greta array with a \\\\\\n              cholesky factor, the output can sometimes be unreliable.", `
#> + `                "See issue here on github for more details:", `
#> + `                "{.url }"))`
#> + `            cholesky_tensor <- tf_chol(tensor)`
#> + `            cholesky_tf_name <- dag$tf_name(self$representation$cholesky)`
#> + `            assign(cholesky_tf_name, cholesky_tensor, envir = dag$tf_environment)`
#> + `        }`
#> + `    }`
#> + `    if (mode == "forward") {`
#> + `        arg_tf_names <- lapply(self$list_parents(dag), dag$tf_name)`
#> + `        tf_args <- lapply(arg_tf_names, get, envir = tfe)`
#> + `        if (length(self$operation_args) > 0) {`
#> + `            tf_args <- c(tf_args, self$operation_args)`
#> + `        }`
#> + `        operation <- eval(parse(text = self$operation), envir = self$tf_function_env)`
#> + `        tensor <- do.call(operation, tf_args)`
#> + `    }`
#> + `    assign(tf_name, tensor, envir = dag$tf_environment)`
#>   `}`
#> 
#> `wishart$children[[1]]$tf_distrib` is a function
#> `chol_wishart$children[[1]]$tf_distrib` is absent
#> 
#> `wishart$children[[1]]$truncatable` is a logical vector (TRUE)
#> `chol_wishart$children[[1]]$truncatable` is absent
#> 
#> `wishart$children[[1]]$truncation` is NULL
#> `chol_wishart$children[[1]]$truncation` is absent
#> 
#> `wishart$children[[1]]$unique_name`:      "node_468d85ac"
#> `chol_wishart$children[[1]]$unique_name`: "node_36be79fe"
#> 
#> `wishart$children[[1]]$user_node` is an R6 object of class <operation_node/node>
#> `chol_wishart$children[[1]]$user_node` is absent
#> 
#> `wishart$children[[1]]$add_argument` is absent
#> `chol_wishart$children[[1]]$add_argument` is a function
#> 
#> `wishart$children[[1]]$arguments` is absent
#> `chol_wishart$children[[1]]$arguments` is a list
#> 
#> `wishart$children[[1]]$operation` is absent
#> `chol_wishart$children[[1]]$operation` is a character vector ('tf_set_dim')
#> 
#> `wishart$children[[1]]$operation_args` is absent
#> `chol_wishart$children[[1]]$operation_args` is a list
#> 
#> `wishart$children[[1]]$operation_name` is absent
#> `chol_wishart$children[[1]]$operation_name` is a character vector ('set_dim')
#> 
#> `wishart$children[[1]]$tf_function_env` is absent
#> `chol_wishart$children[[1]]$tf_function_env` is an environment
#> 
#> `wishart$distribution` is an R6 object of class <wishart_distribution/distribution_node/node>
#> `chol_wishart$distribution` is NULL
#> 
#> `wishart$operation`:      "tf_chol2symm"
#> `chol_wishart$operation`: "tf$identity" 
#> 
#> `wishart$operation_name`:      "chol2symm"
#> `chol_wishart$operation_name`: "identity" 
#> 
#> `wishart$representations` is length 1
#> `chol_wishart$representations` is length 0
#> 
#> `names(wishart$representations)` is a character vector ('cholesky')
#> `names(chol_wishart$representations)` is absent
#> 
#> `wishart$representations$cholesky` is an S3 object of class <greta_array/array>, a double vector
#> `chol_wishart$representations$cholesky` is absent
#> 
#> `wishart$tf_function_env$.Generic`:      "chol2symm"
#> `chol_wishart$tf_function_env$.Generic`: "identity" 
#> 
#> `wishart$tf_function_env$.GenericCallEnv` is length 4
#> `chol_wishart$tf_function_env$.GenericCallEnv` is length 3
#> 
#> names(wishart$tf_function_env$.GenericCallEnv) vs names(chol_wishart$tf_function_env$.GenericCallEnv)
#> - "chol_greta_array"
#> - "matrix_greta_array"
#> - "target_node"
#> - "truncation"
#> + "name"
#> + "repr"
#> + "x"
#> 
#> `wishart$tf_function_env$.GenericCallEnv$chol_greta_array` is an S3 object of class <greta_array/array>, a double vector
#> `chol_wishart$tf_function_env$.GenericCallEnv$chol_greta_array` is absent
#> 
#> `wishart$tf_function_env$.GenericCallEnv$matrix_greta_array` is an S3 object of class <greta_array/array>, a double vector
#> `chol_wishart$tf_function_env$.GenericCallEnv$matrix_greta_array` is absent
#> 
#> `wishart$tf_function_env$.GenericCallEnv$target_node` is an R6 object of class <operation_node/node>
#> `chol_wishart$tf_function_env$.GenericCallEnv$target_node` is absent
#> 
#> `wishart$tf_function_env$.GenericCallEnv$truncation` is NULL
#> `chol_wishart$tf_function_env$.GenericCallEnv$truncation` is absent
#> 
#> `wishart$tf_function_env$.GenericCallEnv$name` is absent
#> `chol_wishart$tf_function_env$.GenericCallEnv$name` is a character vector ('cholesky')
#> 
#> `wishart$tf_function_env$.GenericCallEnv$repr` is absent
#> `chol_wishart$tf_function_env$.GenericCallEnv$repr` is an S3 object of class <greta_array/array>, a double vector
#> 
#> `wishart$tf_function_env$.GenericCallEnv$x` is absent
#> `chol_wishart$tf_function_env$.GenericCallEnv$x` is an S3 object of class <greta_array/array>, a double vector
#> 
#> `parent.env(wishart$tf_function_env$.GenericCallEnv)` is <env:0x11f1fa548>
#> `parent.env(chol_wishart$tf_function_env$.GenericCallEnv)` is <env:namespace:greta>
#> 
#> `wishart$tf_function_env$.Method`:      "chol2symm.greta_array"
#> `chol_wishart$tf_function_env$.Method`: "identity.greta_array" 
#> 
#> `wishart$unique_name`:      "node_e4b6425b"
#> `chol_wishart$unique_name`: "node_4465d07f"

Created on 2024-05-10 with reprex v2.1.0

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.3.3 (2024-02-29)
#>  os       macOS Sonoma 14.3.1
#>  system   aarch64, darwin20
#>  ui       X11
#>  language (EN)
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       Australia/Brisbane
#>  date     2024-05-10
#>  pandoc   3.1.13 @ /opt/homebrew/bin/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version    date (UTC) lib source
#>  base64enc     0.1-3      2015-07-28 [1] CRAN (R 4.3.0)
#>  callr         3.7.6      2024-03-25 [1] CRAN (R 4.3.1)
#>  cli           3.6.2      2023-12-11 [1] CRAN (R 4.3.1)
#>  coda          0.19-4.1   2024-01-31 [2] CRAN (R 4.3.1)
#>  codetools     0.2-20     2024-03-31 [2] CRAN (R 4.3.1)
#>  crayon        1.5.2      2022-09-29 [1] CRAN (R 4.3.0)
#>  diffobj       0.3.5      2021-10-05 [1] CRAN (R 4.3.0)
#>  digest        0.6.35     2024-03-11 [1] CRAN (R 4.3.1)
#>  evaluate      0.23       2023-11-01 [1] CRAN (R 4.3.1)
#>  fansi         1.0.6      2023-12-08 [1] CRAN (R 4.3.1)
#>  fastmap       1.1.1      2023-02-24 [1] CRAN (R 4.3.0)
#>  fs            1.6.3      2023-07-20 [1] CRAN (R 4.3.0)
#>  future        1.33.2     2024-03-26 [1] CRAN (R 4.3.1)
#>  globals       0.16.3     2024-03-08 [1] CRAN (R 4.3.1)
#>  glue          1.7.0      2024-01-09 [1] CRAN (R 4.3.1)
#>  greta       * 0.4.5.9000 2024-05-06 [1] local
#>  hms           1.1.3      2023-03-21 [1] CRAN (R 4.3.0)
#>  htmltools     0.5.8.1    2024-04-04 [1] CRAN (R 4.3.1)
#>  jsonlite      1.8.8      2023-12-04 [1] CRAN (R 4.3.1)
#>  knitr         1.45       2023-10-30 [1] CRAN (R 4.3.1)
#>  lattice       0.22-6     2024-03-20 [1] CRAN (R 4.3.1)
#>  lifecycle     1.0.4      2023-11-07 [1] CRAN (R 4.3.1)
#>  listenv       0.9.1      2024-01-29 [2] CRAN (R 4.3.1)
#>  magrittr      2.0.3      2022-03-30 [1] CRAN (R 4.3.0)
#>  Matrix        1.6-5      2024-01-11 [1] CRAN (R 4.3.1)
#>  parallelly    1.37.1     2024-02-29 [1] CRAN (R 4.3.1)
#>  pillar        1.9.0      2023-03-22 [1] CRAN (R 4.3.0)
#>  pkgconfig     2.0.3      2019-09-22 [1] CRAN (R 4.3.0)
#>  png           0.1-8      2022-11-29 [1] CRAN (R 4.3.0)
#>  prettyunits   1.2.0      2023-09-24 [1] CRAN (R 4.3.1)
#>  processx      3.8.4      2024-03-16 [1] CRAN (R 4.3.1)
#>  progress      1.2.3      2023-12-06 [1] CRAN (R 4.3.1)
#>  ps            1.7.6      2024-01-18 [1] CRAN (R 4.3.1)
#>  purrr         1.0.2      2023-08-10 [1] CRAN (R 4.3.0)
#>  R.cache       0.16.0     2022-07-21 [2] CRAN (R 4.3.0)
#>  R.methodsS3   1.8.2      2022-06-13 [2] CRAN (R 4.3.0)
#>  R.oo          1.26.0     2024-01-24 [2] CRAN (R 4.3.1)
#>  R.utils       2.12.3     2023-11-18 [2] CRAN (R 4.3.1)
#>  R6            2.5.1      2021-08-19 [1] CRAN (R 4.3.0)
#>  Rcpp          1.0.12     2024-01-09 [1] CRAN (R 4.3.1)
#>  rematch2      2.1.2      2020-05-01 [1] CRAN (R 4.3.0)
#>  reprex        2.1.0      2024-01-11 [2] CRAN (R 4.3.1)
#>  reticulate    1.36.1     2024-04-22 [1] CRAN (R 4.3.1)
#>  rlang         1.1.3      2024-01-10 [1] CRAN (R 4.3.1)
#>  rmarkdown     2.26       2024-03-05 [1] CRAN (R 4.3.1)
#>  rstudioapi    0.16.0     2024-03-24 [1] CRAN (R 4.3.1)
#>  sessioninfo   1.2.2      2021-12-06 [2] CRAN (R 4.3.0)
#>  styler        1.10.3     2024-04-07 [2] CRAN (R 4.3.1)
#>  tensorflow    2.16.0     2024-04-15 [2] CRAN (R 4.3.1)
#>  tfruns        1.5.3      2024-04-19 [1] CRAN (R 4.3.1)
#>  tibble        3.2.1      2023-03-20 [1] CRAN (R 4.3.0)
#>  utf8          1.2.4      2023-10-22 [1] CRAN (R 4.3.1)
#>  vctrs         0.6.5      2023-12-01 [1] CRAN (R 4.3.1)
#>  waldo       * 0.5.2      2023-11-02 [1] CRAN (R 4.3.1)
#>  whisker       0.4.1      2022-12-05 [1] CRAN (R 4.3.0)
#>  withr         3.0.0      2024-01-16 [1] CRAN (R 4.3.1)
#>  xfun          0.43       2024-03-25 [1] CRAN (R 4.3.1)
#>  yaml          2.3.8      2023-12-11 [1] CRAN (R 4.3.1)
#> 
#>  [1] /Users/nick/Library/R/arm64/4.3/library
#>  [2] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
#> 
#> ─ Python configuration ───────────────────────────────────────────────────────
#>  python:         /Users/nick/Library/r-miniconda-arm64/envs/greta-env-tf2/bin/python
#>  libpython:      /Users/nick/Library/r-miniconda-arm64/envs/greta-env-tf2/lib/libpython3.11.dylib
#>  pythonhome:     /Users/nick/Library/r-miniconda-arm64/envs/greta-env-tf2:/Users/nick/Library/r-miniconda-arm64/envs/greta-env-tf2
#>  version:        3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:34:54) [Clang 16.0.6 ]
#>  numpy:          /Users/nick/Library/r-miniconda-arm64/envs/greta-env-tf2/lib/python3.11/site-packages/numpy
#>  numpy_version:  1.26.4
#>  tensorflow:     /Users/nick/Library/r-miniconda-arm64/envs/greta-env-tf2/lib/python3.11/site-packages/tensorflow
#>  
#>  NOTE: Python version was forced by use_python() function
#> 
#> ──────────────────────────────────────────────────────────────────────────────
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment