From 95916ef54362e45dc973a92eee42c3fad3760ba3 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Tue, 12 May 2020 15:55:24 -0300 Subject: [PATCH 1/4] update v number + test on 2.2 release --- .github/workflows/main.yaml | 2 +- DESCRIPTION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1f7b15bc1..b79ef8dcf 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: os: ['windows-latest', 'macOS-latest', 'ubuntu-16.04'] - tf: ['1.14.0', '1.15.2', '2.0.1', '2.1.0', '2.2-rc3', 'nightly'] + tf: ['1.14.0', '1.15.2', '2.0.1', '2.1.0', '2.2.0', 'nightly'] include: - os: ubuntu-16.04 cran: https://demo.rstudiopm.com/all/__linux__/xenial/latest diff --git a/DESCRIPTION b/DESCRIPTION index 13843d60d..3427334a5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: keras Type: Package Title: R Interface to 'Keras' -Version: 2.2.5.0 +Version: 2.3.0.0 Authors@R: c( person("Daniel", "Falbel", role = c("ctb", "cph", "cre"), email = "daniel@rstudio.com"), person("JJ", "Allaire", role = c("aut", "cph")), From 5ed9c9b8e8c25045b728d81179bb1e29fff89fe9 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Fri, 15 May 2020 13:42:54 -0300 Subject: [PATCH 2/4] avoid printing when we don't know the number of samples the model was trained on. --- R/history.R | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/R/history.R b/R/history.R index ab7c0d948..c289487f1 100644 --- a/R/history.R +++ b/R/history.R @@ -17,9 +17,13 @@ print.keras_training_history <- function(x, ...) { validate <- paste0(", validated on ", params[["validation_samples"]], " samples") else validate <- "" - str <- paste0("Trained on ", params[["samples"]]," samples", validate, " (batch_size=", - params[["batch_size"]], ", epochs=", params[["epochs"]], ")") - + + str <- "" + if (!params[["samples"]] == "NULL") { + str <- paste0(str, "Trained on ", params[["samples"]]," samples", validate, " (batch_size=", + params[["batch_size"]], ", epochs=", params[["epochs"]], ")") + } + # last epoch metrics metrics <- lapply(x$metrics, function(metric) { metric[[epochs]] From 4f915a1801caaaf9b57cb98ef3149999edb8de10 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 18 May 2020 14:38:29 -0300 Subject: [PATCH 3/4] docs fixing --- R/install.R | 2 +- man/get_layer.Rd | 2 +- man/install_keras.Rd | 2 +- vignettes/guide_keras.Rmd | 2 +- vignettes/index.Rmd | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/install.R b/R/install.R index 012466684..0115fef5b 100644 --- a/R/install.R +++ b/R/install.R @@ -68,7 +68,7 @@ #' desired backend) as described on the [Keras website](https://keras.io/#installation) #' and the Keras R package will find and use that version. #' -#' See the documentation on [custom installations](https://tensorflow.rstudio.com/installation.html#custom-installation) +#' See the documentation on [custom installations](https://tensorflow.rstudio.com/installation/custom/) #' for additional information on how version of Keras and TensorFlow are located #' by the Keras package. #' diff --git a/man/get_layer.Rd b/man/get_layer.Rd index af65b7812..efb8821c4 100644 --- a/man/get_layer.Rd +++ b/man/get_layer.Rd @@ -11,7 +11,7 @@ get_layer(object, name = NULL, index = NULL) \item{name}{String, name of layer.} -\item{index}{Integer, index of layer (0-based)} +\item{index}{Integer, index of layer (1-based)} } \value{ A layer instance. diff --git a/man/install_keras.Rd b/man/install_keras.Rd index 7bf001e72..aa94f807b 100644 --- a/man/install_keras.Rd +++ b/man/install_keras.Rd @@ -84,7 +84,7 @@ to use the Keras R package. You can do a custom installation of Keras (and desired backend) as described on the \href{https://keras.io/#installation}{Keras website} and the Keras R package will find and use that version. -See the documentation on \href{https://tensorflow.rstudio.com/installation.html#custom-installation}{custom installations} +See the documentation on \href{https://tensorflow.rstudio.com/installation/custom/}{custom installations} for additional information on how version of Keras and TensorFlow are located by the Keras package. } diff --git a/vignettes/guide_keras.Rmd b/vignettes/guide_keras.Rmd index d6e79aaac..0704bcad5 100644 --- a/vignettes/guide_keras.Rmd +++ b/vignettes/guide_keras.Rmd @@ -75,7 +75,7 @@ model %>% There are many `layers` available with some common constructor parameters: - - `activation`: Set the [activation function](https://tensorflow.rstudio.com/keras/reference/#section-activation-layers) for the layer. By default, no activation is applied. + - `activation`: Set the [activation function](https://tensorflow.rstudio.com/reference/keras/#section-activation-layers) for the layer. By default, no activation is applied. - `kernel_initializer` and `bias_initializer`: The initialization schemes that create the layer’s weights (kernel and bias). This defaults to the [`Glorot uniform`](https://tensorflow.rstudio.com/keras/reference/initializer_glorot_uniform.html) initializer. diff --git a/vignettes/index.Rmd b/vignettes/index.Rmd index ab968f5b1..d2ec04405 100644 --- a/vignettes/index.Rmd +++ b/vignettes/index.Rmd @@ -57,7 +57,7 @@ install.packages("keras") install_keras() ``` -This will provide you with default CPU-based installations of Keras and TensorFlow. If you want a more customized installation, e.g. if you want to take advantage of NVIDIA GPUs, see the documentation for `install_keras()` and the [installation](/installation/) section. +This will provide you with default CPU-based installations of Keras and TensorFlow. If you want a more customized installation, e.g. if you want to take advantage of NVIDIA GPUs, see the documentation for `install_keras()` and the [installation](https://tensorflow.rstudio.com/installation/) section. ## MNIST Example From aef02422dcc8cfdc42517c3d484166ba3d4843e7 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Tue, 19 May 2020 15:24:50 -0300 Subject: [PATCH 4/4] fix links --- vignettes/custom_layers.Rmd | 2 +- vignettes/faq.Rmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vignettes/custom_layers.Rmd b/vignettes/custom_layers.Rmd index aca23bc21..2bfe85419 100644 --- a/vignettes/custom_layers.Rmd +++ b/vignettes/custom_layers.Rmd @@ -73,7 +73,7 @@ CustomLayer <- R6::R6Class("CustomLayer", ) ``` -Note that tensor operations are executed using the Keras `backend()`. See the [Keras Backend](backend.html) article for details on the various functions available from Keras backends. +Note that tensor operations are executed using the Keras `backend()`. See the Keras Backend article for details on the various functions available from Keras backends. ## Layer Wrapper Function diff --git a/vignettes/faq.Rmd b/vignettes/faq.Rmd index 721e62190..a9a7d6043 100644 --- a/vignettes/faq.Rmd +++ b/vignettes/faq.Rmd @@ -503,7 +503,7 @@ The VGG16 model is also the basis for the [Deep dream](https://keras.rstudio.com ## How can I use other Keras backends? -By default the Keras Python and R packages use the TensorFlow backend. Other available backends include Theano or CNTK. To learn more about using alternatate backends (e.g. Theano or CNTK) see the [article on Keras backends](backend.html). +By default the Keras Python and R packages use the TensorFlow backend. Other available backends include Theano or CNTK. To learn more about using alternatate backends (e.g. Theano or CNTK) see the article on Keras backends. ## How can I use the PlaidML backend?