Skip to content

Commit 58462cb

Browse files
committed
CRAN request: more \value{} Rd tags
1 parent 9e4e094 commit 58462cb

12 files changed

+54
-0
lines changed

R/LearningRateSchedule.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
#'
7878
#' @param call,initialize,get_config
7979
#' Recommended methods to implement. See description and details sections.
80+
#' @returns A function that returns `LearningRateSchedule` instances, similar to the
81+
#' built-in `learning_rate_schedule_*` family of functions.
8082
#' @tether keras.optimizers.schedules.LearningRateSchedule
8183
#' @inheritSection Layer Symbols in scope
8284
#' @inheritParams Layer

R/history.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ print.keras_training_history <- function(x, ...) {
6161
#'
6262
#' @importFrom rlang .data
6363
#'
64+
#' @returns if `method == "ggplot2"`, the ggplot object is returned. If
65+
#' `method == "base"`, then this function will draw to the graphics device and
66+
#' return `NULL`, invisibly.
67+
#'
6468
#' @export
6569
plot.keras_training_history <- function(x, y, metrics = NULL, method = c("auto", "ggplot2", "base"),
6670
smooth = getOption("keras.plot.history.smooth", TRUE),
@@ -171,6 +175,7 @@ plot.keras_training_history <- function(x, y, metrics = NULL, method = c("auto",
171175
else
172176
graphics::legend(legend_location, legend = metric, pch = 1)
173177
}
178+
invisible(NULL)
174179
}
175180
}
176181

R/model-persistence.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,18 @@ load_model_config <- function(filepath, custom_objects = NULL)
341341
#'
342342
#' @param object A keras model.
343343
#'
344+
#' @returns This is called primarily for the side effect of exporting `object`.
345+
#' The first argument, `object` is also returned, invisibly, to enable usage
346+
#' with the pipe.
347+
#'
344348
#' @exportS3Method tensorflow::export_savedmodel
345349
#' @tether keras.Model.export
346350
#' @family saving and loading functions
347351
# @seealso
348352
# + <https://www.tensorflow.org/api_docs/python/tf/keras/Model/export>
349353
export_savedmodel.keras.src.models.model.Model <- function(object, export_dir_base, ...) {
350354
object$export(export_dir_base, ...)
355+
invisible(object)
351356
}
352357

353358

R/model-training.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@
119119
#' wrapped in a `LossScaleOptimizer`, which will dynamically
120120
#' scale the loss to prevent underflow.
121121
#'
122+
#' @returns This is called primarily for the side effect of modifying `object`
123+
#' in-place. The first argument `object` is also returned, invisibly, to
124+
#' enable usage with the pipe.
125+
#'
122126
#' @param object Keras model object
123127
#' @param ... Additional arguments passed on to the `compile()` model method.
124128
#' @export

R/reexports.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
#' @name %>%
66
#' @rdname pipe
77
#' @keywords internal
8+
#' @returns Most commonly, the result of calling the right hand side with the
9+
#' left hand side as an argument: `rhs(lhs)`. See the magritter vignette for
10+
#' other, more advanced, usages.
11+
#' @export
812
#' @export
913
#' @importFrom magrittr %<>% %>%
1014
#' @usage lhs \%>\% rhs
@@ -21,6 +25,8 @@ magrittr::`%<>%`
2125
#' @name %<-%
2226
#' @rdname multi-assign
2327
#' @keywords internal
28+
#' @returns The right-hand-side argument, `value`, invisibly. This called
29+
#' primarily for it's side-effect of assigning symbols in the current frame.
2430
#' @export
2531
#' @importFrom zeallot %<-%
2632
#' @usage x \%<-\% value

man/LearningRateSchedule.Rd

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/compile.keras.src.models.model.Model.Rd

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/export_savedmodel.keras.src.models.model.Model.Rd

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/multi-assign.Rd

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/new_learning_rate_schedule_class.Rd

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)