-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can read 'n_neurons_in_latent_layer' from 'gcae_experiment_params'
- Loading branch information
richelbilderbeek
committed
Jun 14, 2022
1 parent
677b9d1
commit 66225df
Showing
6 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
R/get_n_neurons_in_latent_layer_from_gcae_experiment_params.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#' Get the number of neurons in the layent layer from a `gcae_experiment_params` | ||
#' | ||
#' Get the number of neurons in the layent layer from a `gcae_experiment_params` | ||
#' @inheritParams default_params_doc | ||
#' @return the number of neurons in the latent layer | ||
#' @seealso use \link{get_n_neurons_in_latent_layer} | ||
#' to get the number of neurons in the latent layer | ||
#' for different input arguments | ||
#' @examples | ||
#' get_n_neurons_in_latent_layer_from_gcae_experiment_params( | ||
#' create_test_gcae_experiment_params() | ||
#' ) | ||
#' @author Richèl J.C. Bilderbeek | ||
#' @export | ||
get_n_neurons_in_latent_layer_from_gcae_experiment_params <- function( # nolint indeed a long function name | ||
gcae_experiment_params | ||
) { | ||
gcaer::check_gcae_experiment_params(gcae_experiment_params) | ||
model_filename <- gcaer::get_gcae_model_filename( | ||
model_id = gcae_experiment_params$gcae_setup$model_id, | ||
gcae_options = gcae_experiment_params$gcae_options | ||
) | ||
model <- read_model_file(model_filename = model_filename) | ||
gcaer::get_n_neurons_in_latent_layer_from_model(model = model) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#' Determine if the `gcae_experiment_params` is indeed a `gcae_experiment_params` | ||
#' @inheritParams default_params_doc | ||
#' @return \link{TRUE} if the `gcae_experiment_params` is indeed a `gcae_experiment_params` | ||
#' @examples | ||
#' # TRUE | ||
#' is_gcae_experiment_params(create_test_gcae_experiment_params()) | ||
#' | ||
#' # FALSE | ||
#' is_gcae_experiment_params(gcae_experiment_params = "nonsense") | ||
#' is_gcae_experiment_params("nonsense", verbose = TRUE) | ||
#' @author Richèl J.C. Bilderbeek | ||
#' @export | ||
is_gcae_experiment_params <- function( | ||
gcae_experiment_params, | ||
verbose = FALSE | ||
) { | ||
plinkr::check_verbose(verbose) | ||
result <- FALSE | ||
tryCatch({ | ||
gcaer::check_gcae_experiment_params( | ||
gcae_experiment_params = gcae_experiment_params | ||
) | ||
result <- TRUE | ||
}, error = function(e) { | ||
if (verbose) message(e$message) | ||
} | ||
) | ||
result | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters