Skip to content

Commit 6dd64b9

Browse files
committed
global-ish replace python -> Python
1 parent f743bee commit 6dd64b9

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ SavedModel format.
603603
- Don't re-export `install_tensorflow()` and `tf_config()` from tensorflow
604604
package.
605605

606-
- `is_keras_available()` function to probe whether the Keras python
606+
- `is_keras_available()` function to probe whether the Keras Python
607607
package is available in the current environment.
608608

609609
- `as.data.frame()` S3 method for Keras training history

R/install.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Install TensorFlow and Keras, including all python dependencies
1+
#' Install TensorFlow and Keras, including all Python dependencies
22
#'
33
#' This function will install Tensorflow and all Keras dependencies. This is a
44
#' thin wrapper around [`tensorflow::install_tensorflow()`], with the only

R/preprocessing.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ text_one_hot <- function(input_text, n, filters = '!"#$%&()*+,-./:;<=>?@[\\]^_`{
213213
#'
214214
#' @param text Input text (string).
215215
#' @param n Dimension of the hashing space.
216-
#' @param hash_function if `NULL` uses python `hash` function, can be 'md5' or
217-
#' any function that takes in input a string and returns a int. Note that
216+
#' @param hash_function if `NULL` uses the Python `hash()` function. Otherwise can be `'md5'` or
217+
#' any function that takes in input a string and returns an int. Note that
218218
#' `hash` is not a stable hashing function, so it is not consistent across
219-
#' different runs, while 'md5' is a stable hashing function.
219+
#' different runs, while `'md5'` is a stable hashing function.
220220
#' @param filters Sequence of characters to filter out such as
221221
#' punctuation. Default includes basic punctuation, tabs, and newlines.
222222
#' @param lower Whether to convert the input to lowercase.
@@ -906,7 +906,7 @@ flow_images_from_directory <- function(
906906
#' image data, which is useful to use in `predict_generator()`).
907907
#'
908908
#' @note
909-
#' This functions requires that `pandas` (python module) is installed in the
909+
#' This functions requires that `pandas` (Python module) is installed in the
910910
#' same environment as `tensorflow` and `keras`.
911911
#'
912912
#' If you are using `r-tensorflow` (the default environment) you can install
@@ -928,7 +928,7 @@ flow_images_from_dataframe <- function(
928928
interpolation = "nearest", drop_duplicates = NULL) {
929929

930930
if (!reticulate::py_module_available("pandas"))
931-
stop("Pandas (python module) must be installed in the same environment as Keras.",
931+
stop("Pandas (Python module) must be installed in the same environment as Keras.",
932932
'Install it using reticulate::virtualenv_install("pandas", envname = "r-tensorflow") ',
933933
'or reticulate::conda_install("pandas", envname = "r-tensorflow") depending on ',
934934
'the kind of environment you are using.')

R/utils.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ keras_array <- function(x, dtype = NULL) {
283283

284284
#' Check if Keras is Available
285285
#'
286-
#' Probe to see whether the Keras python package is available in the current
286+
#' Probe to see whether the Keras Python package is available in the current
287287
#' system environment.
288288
#'
289289
#' @param version Minimum required version of Keras (defaults to `NULL`, no
@@ -429,7 +429,7 @@ capture_args <- function(cl, modifiers = NULL, ignore = NULL,
429429
if("..." %in% fn_arg_nms && !"..." %in% ignore) {
430430
assert_all_dots_named(envir, cl)
431431
# this might reorder args by assuming ... are last, but it doesn't matter
432-
# since everything is supplied as a keyword arg to the python side anyway
432+
# since everything is supplied as a keyword arg to the Python side anyway
433433
cl2 <- c(cl2, quote(...))
434434
}
435435

vignettes/faq.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,12 @@ You can pass the `version` argument to check for a specific version of Keras.
554554

555555
### Keras Module
556556

557-
Another consideration is gaining access to the underlying Keras python module. You might need to do this if you require lower level access to Keras than is provided for by the Keras R package.
557+
Another consideration is gaining access to the underlying Keras Python module. You might need to do this if you require lower level access to Keras than is provided for by the Keras R package.
558558

559559
Since the Keras R package can bind to multiple different implementations of Keras (either the original Keras or the TensorFlow implementation of Keras), you should use the `keras::implementation()` function to obtain access to the correct python module. You can use this function within the `.onLoad` function of a package to provide global access to the module within your package. For example:
560560

561561
```{r}
562-
# Keras python module
562+
# Keras Python module
563563
keras <- NULL
564564
565565
# Obtain a reference to the module from the keras R package

vignettes/new-guides/making_new_layers_and_models_via_subclassing.Rmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ y <- linear_layer(x)
7070
print(y)
7171
```
7272

73-
`Linear` behaves similarly to a layer present in the python interface to keras
73+
`Linear` behaves similarly to a layer present in the Python interface to keras
7474
(e.g., `keras$layers$Dense`).
7575

7676
However, one additional step is needed to make it behave like the builtin layers
@@ -937,19 +937,19 @@ For more information, make sure to read the [Functional API guide](/guides/funct
937937

938938
## Defining custom layers and models in an R package
939939

940-
Unfortunately you can't use anything that creates references to python objects, at the top-level of an R package.
940+
Unfortunately you can't use anything that creates references to Python objects, at the top-level of an R package.
941941

942942
Here is why: when you build an R package, all the R files in the `R/` directory get sourced
943943
in an R environment (the package namespace), and then that environment is saved
944944
as part of the package bundle. Loading the package means restoring the saved R
945945
environment. This means that the R code only gets sourced once, at build time.
946-
If you create references to external objects (e.g., python objects) at package
946+
If you create references to external objects (e.g., Python objects) at package
947947
build time, they will be NULL pointers when the package is loaded, because the
948948
external objects they pointed to at build time no longer exist at load time.
949949

950-
The solution is to delay creating references to python objects until run time.
950+
The solution is to delay creating references to Python objects until run time.
951951
Fortunately, `%py_class%`, `Layer()`, and `create_layer_wrapper(R6Class(...))`
952-
are all lazy about initializing the python reference, so they are safe to define
952+
are all lazy about initializing the Python reference, so they are safe to define
953953
and export in an R package.
954954

955955
If you're writing an R package that uses keras and reticulate,

0 commit comments

Comments
 (0)