Skip to content

Commit

Permalink
add implementation() function to export keras python module
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Jul 26, 2017
1 parent 1f346c9 commit b7d1fef
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export(image_load)
export(image_to_array)
export(imagenet_decode_predictions)
export(imagenet_preprocess_input)
export(implementation)
export(inception_v3_preprocess_input)
export(initializer_constant)
export(initializer_glorot_normal)
Expand Down
22 changes: 22 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,28 @@ normalize <- function(x, axis = -1, order = 2) {
}


#' Keras implementation
#'
#' Obtain a reference to the Python module used for the implementation of Keras.
#'
#' There are currently two Python modules which implement Keras:
#'
#' - keras ("keras")
#' - tensorflow.contrib.keras ("tensorflow")
#'
#' This function returns a reference to the implementation being currently
#' used by the keras package. The default implementation is "tensorflow".
#' You can override this by setting the `KERAS_IMPLEMENTATION` environment
#' variable to "keras".
#'
#' @return Reference to the Python module used for the implementation of Keras.
#'
#' @export
implementation <- function() {
keras
}


#' Keras backend tensor engine
#'
#' Obtain a reference to the `keras.backend` Python module used to implement
Expand Down
26 changes: 26 additions & 0 deletions man/implementation.Rd

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

0 comments on commit b7d1fef

Please sign in to comment.