Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Nov 25, 2024
1 parent afd1190 commit c39e03b
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 24 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ export(.udfMd5Info)
export(.useUtf)
export(.vecDf)
export(ELU)
export(GELU)
export(PReLU)
export(ReLU)
export(RxODE)
Expand Down Expand Up @@ -391,6 +392,7 @@ export(d3GELU)
export(d4GELU)
export(dELU)
export(dELUa)
export(dGELU)
export(dPReLU)
export(dPReLUa)
export(dPReLUa1)
Expand Down
14 changes: 9 additions & 5 deletions R/gelu.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
#' @param x numeric vector
#' @return numeric vector
#' @family Activation Functions
#' @export
#' @examples
#'
#' GELU(c(-2, -1, 0, 1, 2))
#'
#' # you can use rxode2 as well
#' r <- rxode2({r = GELU(x)})
#' r <- rxode2({
#' r = GELU(time)
#' })
#' et <- et(c(-2, -1, 0, 1, 2))
#' rxSolve(r, et)
#'
Expand All @@ -23,17 +26,18 @@ GELU <- function(x) {
#' @param x numeric vector
#' @return numeric vector
#' @family Activation Functions
#' @export
#' @examples
#' dGELU(c(-2, -1, 0, 1, 2))
#' d2GELU(c(-2, -1, 0, 1, 2))
#' d3GELU(c(-2, -1, 0, 1, 2))
#' d4GELU(c(-2, -1, 0, 1, 2))
#' # you can use rxode2 as well
#' r <- rxode2({
#' r1 <- dGELU(x)
#' r2 <- d2GELU(x)
#' r3 <- d3GELU(x)
#' r4 <- d4GELU(x)
#' r1 <- dGELU(time)
#' r2 <- d2GELU(time)
#' r3 <- d3GELU(time)
#' r4 <- d4GELU(time)
#' })
#' et <- et(c(-2, -1, 0, 1, 2))
#' rxSolve(r, et)
Expand Down
8 changes: 1 addition & 7 deletions R/softplus.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' # You can use rxode2 too:
#'
#' r <- rxode2({
#' s <- softplus(x)
#' s <- softplus(time)
#' })
#'
#' e <- et(c(-1, 0, 1, 2))
Expand All @@ -34,17 +34,11 @@ softplus <- function(x) {
#' @examples
#'
#' dsoftplus(c(-1, 0, 1, 2))
#' d2softplus(c(-1, 0, 1, 2))
#' d3softplus(c(-1, 0, 1, 2))
#' d4softplus(c(-1, 0, 1, 2))
#'
#' # You can use rxode2 too:
#'
#' r <- rxode2({
#' s1 <- dsoftplus(time)
#' s2 <- d2softplus(time)
#' s3 <- d3softplus(time)
#' s4 <- d4softplus(time)
#' })
#'
#' e <- et(c(-1, 0, 1, 2))
Expand Down
4 changes: 3 additions & 1 deletion man/GELU.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/dGELU.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/dsoftplus.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/reexports.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/softplus.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c39e03b

Please sign in to comment.