Skip to content

Commit

Permalink
minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
martinju committed Jan 5, 2024
1 parent 364d849 commit 82d0296
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,5 @@ importFrom(stats,sd)
importFrom(stats,setNames)
importFrom(utils,head)
importFrom(utils,methods)
importFrom(utils,modifyList)
importFrom(utils,tail)
useDynLib(shapr, .registration = TRUE)
12 changes: 5 additions & 7 deletions R/approach_vaeac_torch_modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@
#' \log p_{\theta, \psi}(x|y) \approx
#' \log {\frac{1}{K} \sum_{i=1}^K [p_\theta(x|z_i, y) * p_\psi(z_i|y) / q_\phi(z_i|x,y)]} \newline
#' =
#' \log {\sum_{i=1}^K \exp(log[p_\theta(x|z_i, y) * p_\psi(z_i|y) / q_\phi(z_i|x,y)])} - \log(K) \newline
#' \log {\sum_{i=1}^K \exp(\log[p_\theta(x|z_i, y) * p_\psi(z_i|y) / q_\phi(z_i|x,y)])} - \log(K) \newline
#' =
#' \log {\sum_{i=1}^K \exp(log[p_\theta(x|z_i, y)] + \log[p_\psi(z_i|y)] - \log[q_\phi(z_i|x,y)])} - \log(K) \newline
#' \log {\sum_{i=1}^K \exp(\log[p_\theta(x|z_i, y)] + \log[p_\psi(z_i|y)] - \log[q_\phi(z_i|x,y)])} - \log(K) \newline
#' =
#' \operatorname{logsumexp}(\log[p_\theta(x|z_i, y)] + \log[p_\psi(z_i|y)] - \log[q_\phi(z_i|x,y)]) - \log(K) \newline
#' =
Expand All @@ -114,10 +114,10 @@
#' @keywords internal
vaeac <- torch::nn_module(

# @field Name of the \code{\link[torch]{nn_module}} object
# Name of the torch::nn_module object
classname = "vaeac",

# @description Initializing a vaeac model
# Initializing a vaeac model
initialize = function(one_hot_max_sizes,
width = 32,
depth = 3,
Expand Down Expand Up @@ -497,10 +497,8 @@ Chose one of 'MCAR_mask_generator', 'Specified_prob_mask_generator', and 'Specif
self$num_train_param <- num_train_param
},

# @description Forward functions are required in torch::nn_modules,
# Forward functions are required in torch::nn_modules,
# but is it not needed in the way we have implemented vaeac.
#
# @param ... Anything, as the function does not use it.
forward = function(...) {
warning("NO FORWARD FUNCTION IMPLEMENTED FOR VAEAC.")
return("NO FORWARD FUNCTION IMPLEMENTED FOR VAEAC.")
Expand Down

0 comments on commit 82d0296

Please sign in to comment.