diff --git a/R/layers-normalization.R b/R/layers-normalization.R index 227c486f3..32d6f2ad2 100644 --- a/R/layers-normalization.R +++ b/R/layers-normalization.R @@ -473,7 +473,7 @@ function (object, layer, power_iterations = 1L, ...) #' #' # Examples #' ```{r} -#' data <- op_reshape(1:6, newshape = c(2, 3)) +#' data <- 1:6 |> op_array("float32") |> op_reshape(c(2, 3)) #' normalized_data <- layer_unit_normalization(data) #' op_sum(normalized_data[1, ]^2) #' ``` diff --git a/R/utils.R b/R/utils.R index 17f8c6421..5c5986df5 100644 --- a/R/utils.R +++ b/R/utils.R @@ -128,6 +128,7 @@ function (tensor) #' # Examples #' ```{r} #' path_to_downloaded_file <- get_file( +#' "flower_photos", #' origin = "https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz", #' extract = TRUE #' ) diff --git a/man/get_file.Rd b/man/get_file.Rd index d13a955fe..730cbcad4 100644 --- a/man/get_file.Rd +++ b/man/get_file.Rd @@ -78,7 +78,8 @@ Passing a hash will verify the file after download. The command line programs \code{shasum} and \code{sha256sum} can compute the hash. } \section{Examples}{ -\if{html}{\out{
}}\preformatted{path_to_downloaded_file <- get_file( +\if{html}{\out{
}}\preformatted{path_to_downloaded_file <- get_file( + "flower_photos", origin = "https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz", extract = TRUE ) diff --git a/man/layer_integer_lookup.Rd b/man/layer_integer_lookup.Rd index 1e639a3cc..bd648ff94 100644 --- a/man/layer_integer_lookup.Rd +++ b/man/layer_integer_lookup.Rd @@ -48,7 +48,7 @@ for OOV indices. Defaults to \code{-1}.} \item{vocabulary}{Optional. Either an array of integers or a string path to a text file. If passing an array, can pass a list, list, -1D NumPy array, or 1D tensor containing the integer vocbulary terms. +1D NumPy array, or 1D tensor containing the integer vocabulary terms. If passing a file path, the file should contain one line per term in the vocabulary. If this argument is set, there is no need to \code{adapt()} the layer.} diff --git a/man/layer_string_lookup.Rd b/man/layer_string_lookup.Rd index dde622685..4ec0da0a3 100644 --- a/man/layer_string_lookup.Rd +++ b/man/layer_string_lookup.Rd @@ -49,7 +49,7 @@ indices. Defaults to \code{"[UNK]"}.} \item{vocabulary}{Optional. Either an array of integers or a string path to a text file. If passing an array, can pass a list, list, -1D NumPy array, or 1D tensor containing the integer vocbulary terms. +1D NumPy array, or 1D tensor containing the integer vocabulary terms. If passing a file path, the file should contain one line per term in the vocabulary. If this argument is set, there is no need to \code{adapt()} the layer.} diff --git a/man/layer_tfsm.Rd b/man/layer_tfsm.Rd index 32dcacc16..b9fa51b03 100644 --- a/man/layer_tfsm.Rd +++ b/man/layer_tfsm.Rd @@ -59,8 +59,8 @@ model |> export_savedmodel("path/to/artifact") ## Output Type: ## TensorSpec(shape=(None, 10), dtype=tf.float32, name=None) ## Captures: -## 130786084334736: TensorSpec(shape=(), dtype=tf.resource, name=None) -## 130786084333584: TensorSpec(shape=(), dtype=tf.resource, name=None) +## 131686858665488: TensorSpec(shape=(), dtype=tf.resource, name=None) +## 131686858664336: TensorSpec(shape=(), dtype=tf.resource, name=None) }\if{html}{\out{
}} diff --git a/man/layer_unit_normalization.Rd b/man/layer_unit_normalization.Rd index 7aa553eb3..10bb2f56e 100644 --- a/man/layer_unit_normalization.Rd +++ b/man/layer_unit_normalization.Rd @@ -32,9 +32,13 @@ Normalize a batch of inputs so that each input in the batch has a L2 norm equal to 1 (across the axes specified in \code{axis}). } \section{Examples}{ -\if{html}{\out{
}}\preformatted{data <- op_reshape(1:6, newshape = c(2, 3)) +\if{html}{\out{
}}\preformatted{data <- 1:6 |> op_array("float32") |> op_reshape(c(2, 3)) normalized_data <- layer_unit_normalization(data) op_sum(normalized_data[1, ]^2) +}\if{html}{\out{
}} + +\if{html}{\out{
}}\preformatted{## tf.Tensor(0.9999999, shape=(), dtype=float32) + }\if{html}{\out{
}} }