Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 728-wnl-style-linear-…
Browse files Browse the repository at this point in the history
…compartment-models-using-combined-rxode2
  • Loading branch information
mattfidler committed Nov 25, 2024
2 parents ac87392 + 4a5481a commit 96e28c7
Show file tree
Hide file tree
Showing 36 changed files with 2,497 additions and 115 deletions.
25 changes: 25 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,13 @@ export(.udfExists)
export(.udfMd5Info)
export(.useUtf)
export(.vecDf)
export(ELU)
export(GELU)
export(PReLU)
export(ReLU)
export(RxODE)
export(SELU)
export(Swish)
export(add.dosing)
export(add.sampling)
export(aes)
Expand Down Expand Up @@ -380,7 +386,24 @@ export(binomProbs)
export(boxCox)
export(boxCoxInv)
export(cvPost)
export(d2ELU)
export(d2ELUa)
export(d2GELU)
export(d2aELU)
export(d3GELU)
export(d4GELU)
export(dELU)
export(dELUa)
export(dGELU)
export(dPReLU)
export(dPReLUa)
export(dPReLUa1)
export(dReLU)
export(dSELU)
export(dSwish)
export(dfWishart)
export(dlReLU)
export(dsoftplus)
export(erf)
export(et)
export(etExpand)
Expand Down Expand Up @@ -416,6 +439,7 @@ export(invWR1d)
export(is.rxEt)
export(is.rxSolve)
export(is.rxStackData)
export(lReLU)
export(label_both)
export(label_context)
export(label_value)
Expand Down Expand Up @@ -639,6 +663,7 @@ export(scale_y_continuous)
export(scale_y_date)
export(scale_y_discrete)
export(setRxThreads)
export(softplus)
export(stat_amt)
export(stat_cens)
export(swapMatListWithCube)
Expand Down
175 changes: 168 additions & 7 deletions R/d.R
Original file line number Diff line number Diff line change
Expand Up @@ -624,24 +624,185 @@
}
)

.rxD$ReLU <- list(
function(x) {
paste0("dReLU(", x, ")")
}
)

.rxD$dReLU <- list(
function(x) {
paste0("0")
}
)

.rxD$GELU <- list(
function(x) {
paste0("dGELU(", x, ")")
}
)

.rxD$dGELU <- list(
function(x) {
paste0("d2GELU(", x, ")")
}
)

.rxD$d2GELU <- list(
function(x) {
paste0("d3GELU(", x, ")")
}
)

.rxD$d3GELU <- list(
function(x) {
paste0("d4GELU(", x, ")")
}
)

.rxD$ELU <- list(
function(x, alpha) {
paste0("dELU(", x, ", ", alpha, ")")
},
function(x, alpha) {
paste0("dELUa(", x, ", ", alpha, ")")
})

.rxD$dELU <- list(
function(x, alpha) {
paste0("d2ELU(", x, ", ", alpha, ")")
},
function(x, alpha) {
paste0("d2aELU(", x, ", ", alpha, ")")
})

.rxD$dELUa <- list(
function(x, alpha) {
paste0("d2ELUa(", x, ", ", alpha, ")")
},
function(x, alpha) {
paste0("0")
}
)
.rxD$d2ELUa <- list(
function(x, alpha) {
paste0("d2ELUa(", x, ", ", alpha, ")")
},
function(x, alpha) {
paste0("0")
}
)

.rxD$d2ELU <- list(
function(x, alpha) {
paste0("d2ELU(", x, ", ", alpha, ")")
},
function(x, alpha) {
paste0("d2aELU(", x, ", ", alpha, ")")
})

.rxD$d2aELU <- list(
function(x, alpha) {
paste0("d2aELU(", x, ", ", alpha, ")")
},
function(x, alpha) {
paste0("0")
})

.rxD$softplus <- list(
function(x) {
paste0("dsoftplus(", x, ")")
})

.rxD$dsoftplus <- list(
function(x) {
paste0("d2softplus(", x, ")")
})

.rxD$d2softplus <- list(
function(x) {
paste0("d3softplus(", x, ")")
})

.rxD$d3softplus <- list(
function(x) {
paste0("d4softplus(", x, ")")
})

.rxD$SELU <- list(
function(x) {
paste0("dSELU(", x, ")")
})


.rxD$lReLU <- list(
function(x) {
paste0("dlReLU(", x, ")")
}
)

.rxD$dlReLU <- list(
function(x) {
paste0("0")
}
)

.rxD$PReLU <- list(
function(x, alpha) {
paste0("dPReLU(", x, ",", alpha, ")")
},
function(x, alpha) {
paste0("dPReLUa(", x, ",", alpha, ")")
})

.rxD$dPReLU <- list(
function(x, alpha) {
paste0("0")
},
function(x, alpha) {
paste0("dPReLUa1(", x, ",", alpha, ")")
})

.rxD$dPReLUa <- list(
function(x, alpha) {
paste0("dPReLUa1(", x, ",", alpha, ")")
},
function(x, alpha) {
paste0("0")
})

.rxD$dPReLUa1 <- list(
function(x, alpha) {
paste0("0")
},
function(x, alpha) {
paste0("0")
}
)

.rxD$Swish <- list(
function(x) {
paste0("dSwish(", x, ")")
}
)

#' This gives the derivative table for rxode2
#'
#' This will help allow registration of functions in `rxode2`
#'
#' This will help allow registration of functions in `rxode2`
#'
#' @return Derivative table environment for rxode2
#' @details
#'
#'
#' This environment is a derivative table;
#'
#'
#' For example:
#'
#'
#' Derivative(f(a,b,c), a) = fa()
#' Derivative(f(a,b,c), b) = fb()
#' Derivative(f(a,b,c), c) = fc()
#'
#'
#' Then the derivative table for `f` would be:
#'
#'
#' assign("f", list(fa(a,b,c), fb(a,b,c), fc(a,b,c)), rxode2parseD())
#'
#' fa translates the arguments to the derivative with respect to a
Expand Down
Loading

0 comments on commit 96e28c7

Please sign in to comment.