Skip to content

Commit

Permalink
BugFix in documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
FBerding committed Jun 30, 2023
1 parent f6a0b64 commit c0f0703
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 85 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: macos-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -72,7 +72,10 @@ jobs:
#conda_create(envname="r-reticulate",
# conda=Sys.which("python"))
conda_install("r-reticulate", python_packages,pip=TRUE)
#conda_install("r-reticulate", python_packages,pip=TRUE)
aifeducation::install_py_modules("r-reticulate")
#path_to_python <- virtualenv_python("r-reticulate")
path_to_python <- conda_python("r-reticulate")
Expand Down
10 changes: 5 additions & 5 deletions R/te_classifier_neuralnet_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,9 @@ TextEmbeddingClassifierNeuralNet<-R6::R6Class(
if(features %% 2 !=0){
stop("The number of features of the TextEmbeddingmodel is
not a multiple of 2.")

}
}



#Saving Configuration
config=list(
hidden=hidden,
Expand Down Expand Up @@ -509,6 +506,7 @@ TextEmbeddingClassifierNeuralNet<-R6::R6Class(
private$init_weights=model$get_weights()
self$model_config$n_req=length(config$rec)
self$model_config$n_hidden=length(config$hidden)
self$model_config$n_self_attention_heads=config$self_attention_heads
self$model_config$target_levels=target_levels_order
self$model_config$input_variables=variable_name_order
self$model_config$init_config=config
Expand Down Expand Up @@ -1727,7 +1725,8 @@ TextEmbeddingClassifierNeuralNet<-R6::R6Class(
#Ensuring the correct order of the variables for prediction
real_newdata<-real_newdata[,,self$model_config$input_variables,drop=FALSE]
current_row_names=rownames(real_newdata)
if(self$model_config$n_req==0){
if(self$model_config$n_req==0 &
self$model_config$n_self_attention_heads==0){
real_newdata=array_to_matrix(real_newdata)
}

Expand Down Expand Up @@ -1955,7 +1954,8 @@ TextEmbeddingClassifierNeuralNet<-R6::R6Class(
target_test_transformed<-as.numeric(target_test)-1

#Convert Input data if the network cannot process sequential data
if(self$model_config$n_req==0){
if(self$model_config$n_req==0 &
self$model_config$n_self_attention_heads==0){
input_embeddings_train= array_to_matrix(data_embedding_train)
input_embeddings_test=array_to_matrix(data_embedding_test)
} else {
Expand Down
Loading

0 comments on commit c0f0703

Please sign in to comment.