Skip to content

Commit

Permalink
update to keras3 for compatibility with newst R (see rstudio/keras3#1428
Browse files Browse the repository at this point in the history
)
  • Loading branch information
OliverSchacht committed Jul 31, 2024
1 parent 1db7dd4 commit 406b77f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions PM3/r_functional_approximation_by_nn_and_rf.irnb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"install.packages(\"randomForest\")\n",
"install.packages(\"rpart\")\n",
"install.packages(\"gbm\")\n",
"install.packages(\"keras\")"
"install.packages(\"keras3\")"
]
},
{
Expand All @@ -56,7 +56,7 @@
"library(randomForest)\n",
"library(rpart)\n",
"library(gbm)\n",
"library(keras)"
"library(keras3)"
]
},
{
Expand Down Expand Up @@ -356,7 +356,7 @@
" layer_dense(units = 1)\n",
"\n",
" model %>% compile(\n",
" optimizer = optimizer_adam(lr = 0.01),\n",
" optimizer = optimizer_adam(learning_rate = 0.01),\n",
" loss = \"mse\",\n",
" metrics = c(\"mae\"),\n",
" )\n",
Expand Down Expand Up @@ -475,7 +475,7 @@
"\n",
"# Compile the model\n",
"model %>% compile(\n",
" optimizer = optimizer_adam(lr = 0.01),\n",
" optimizer = optimizer_adam(learning_rate = 0.01),\n",
" loss = \"mse\",\n",
" metrics = c(\"mae\"),\n",
")\n",
Expand Down
6 changes: 3 additions & 3 deletions PM3/r_ml_wage_prediction.irnb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"install.packages(\"nnet\")\n",
"install.packages(\"gbm\")\n",
"install.packages(\"rpart.plot\")\n",
"install.packages(\"keras\")"
"install.packages(\"keras3\")"
]
},
{
Expand All @@ -78,7 +78,7 @@
"library(nnet)\n",
"library(gbm)\n",
"library(rpart.plot)\n",
"library(keras)"
"library(keras3)"
]
},
{
Expand Down Expand Up @@ -1281,7 +1281,7 @@
"\n",
"# Compile the model\n",
"model %>% compile(\n",
" optimizer = optimizer_adam(lr = 0.01),\n",
" optimizer = optimizer_adam(learning_rate = 0.01),\n",
" loss = \"mse\",\n",
" metrics = c(\"mae\"),\n",
")\n",
Expand Down

0 comments on commit 406b77f

Please sign in to comment.