Skip to content

Commit

Permalink
fix few Help typos (#147)
Browse files Browse the repository at this point in the history
* fix help typo

* remove duplicate arg

* fix typo

* fix typo in csv_logger

* fix typo

* fix typo.

* fix typos in callback

* fix typo

* add new author
  • Loading branch information
cregouby authored Jul 30, 2024
1 parent fdc660b commit cafc744
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 34 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Title: Higher Level 'API' for 'torch'
Version: 0.4.0.9002
Authors@R: c(
person("Daniel", "Falbel", email = "daniel@rstudio.com", role = c("aut", "cre", "cph")),
person("Christophe", "Regouby", email = "christophe.regouby@free.fr", role = c("ctb")),
person(family = "RStudio", role = c("cph"))
)
Description: A high level interface for 'torch' providing utilities to reduce the
Expand Down
2 changes: 1 addition & 1 deletion R/callbacks-resume.R
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ luz_callback_auto_resume <- luz_callback(
#' Allow resume model training from a specific checkpoint
#'
#' @param path Path to the checkpoint that you want to resume.
#' @param restore_model_state Wether to restore the model state from the callback.
#' @param restore_model_state Wether to restore the model state from the checkpoint.
#' @param restore_records Wether to restore records from the checkpoint.
#' @param restore_optimizer_state Wether to restore the optimizer state from the
#' checkpoint.
Expand Down
6 changes: 3 additions & 3 deletions R/callbacks.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ default_evaluate_callbacks <- function() {
#' @section Prediction callbacks:
#'
#' You can also use callbacks when using [predict()]. In this case the supported
#' callback methods are detailed above.
#' callback methods are detailed below:
#'
#' ```
#' Start predict
Expand Down Expand Up @@ -382,7 +382,7 @@ luz_callback_metrics <- luz_callback(
#' - `ctx$loss`: Resets the `loss` attribute to `list()` when finished training/ or
#' validating.
#'
#' @note In general you won't need to explicitly use the metrics callback as it's
#' @note In general you won't need to explicitly use the train_valid callback as it's
#' used by default in [fit.luz_module_generator()].
#'
#' @returns
Expand Down Expand Up @@ -466,7 +466,7 @@ luz_callback_lr_scheduler <- luz_callback(

#' CSV logger callback
#'
#' Logs metrics obtained during training a fiel on disk.
#' Logs metrics obtained during training a file on disk.
#' The file will have 1 line for each epoch/validation.
#'
#' @param path path to a file on disk.
Expand Down
5 changes: 2 additions & 3 deletions R/context.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ NULL
#' See also [ctx].
#'
#' @param name name of the metric
#' @param value value to log
#' @param what (string) What you are logging.
#' @param set (string) Usually 'train' or 'valid' indicating the set you want
#' to lot to. But can be arbitrary info.
#' to log to. But can be arbitrary info.
#' @param value Arbitrary value to log.
#' @param index Index that this value should be logged. If `NULL` the value
#' is added to the end of list, otherwise the index is used.
Expand Down Expand Up @@ -80,7 +79,7 @@ context <- R6::R6Class(
invisible(self)
},
#' @description
#' Log a metric gen its name and value.
#' Log a metric by its name and value.
#' Metric values are indexed by epoch.
log_metric = function(name, value) {
set <- if (self$training) "train" else "valid"
Expand Down
4 changes: 2 additions & 2 deletions R/serialization.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#'
#' @param obj an object of class 'luz_module_fitted' as returned by
#' [fit.luz_module_generator()].
#' @param path path in file system so save the object.
#' @param path path in file system to the object.
#' @param ... currently unused.
#'
#' @family luz_save
Expand Down Expand Up @@ -137,7 +137,7 @@ luz_checkpoint <- function(ctx, path) {
#'
#' Works with checkpoints created typically with [luz_callback_model_checkpoint()].
#'
#' @param obj Object to which we want to laod the checkpoint.
#' @param obj Object to which we want to load the checkpoint.
#' @param path Path of the checkpoint on disk.
#' @param ... unused. Is there to allow future extensions.
#'
Expand Down
16 changes: 6 additions & 10 deletions man/context.Rd

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

4 changes: 2 additions & 2 deletions man/luz_callback.Rd

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

6 changes: 3 additions & 3 deletions man/luz_callback_csv_logger.Rd

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

6 changes: 3 additions & 3 deletions man/luz_callback_resume_from_checkpoint.Rd

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

6 changes: 3 additions & 3 deletions man/luz_callback_train_valid.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/luz_load.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/luz_load_checkpoint.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/luz_save.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/rmd/callbacks.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Here's an overview of possible callback *breakpoints*:
- on_fit_end
End Fit

Every step market with `on_*` is a point in the training procedure that is available for callbacks to be called.
Every step marked with `on_*` is a point in the training procedure that is available for callbacks to be called.

The other important part of callbacks is the `ctx` (context) object.
See `help("ctx")` for details.
Expand Down

0 comments on commit cafc744

Please sign in to comment.