R:path.expand(path)中的错误:无效的'path'参数

问题描述 投票:0回答:1

我遇到此错误。

features <- layer_input(shape = c(ncol(dat.X)))
Error in path.expand(path) : invalid 'path' argument

这里是完整代码

library(keras)
# we fit j =0 with feature matrix dat.X , claims dat$C1 and volumes dat$C0
dat <- Final
dat.X <- dat[-c(12:15)]
dat.Y <- as.matrix( dat$C1 / sqrt ( dat$C0 )) # observed responses
dat.W <- as.matrix( sqrt( dat$C0 )) # volumes used as offsets
q <- 20 # number of hidden neurons

# definition of neural network
features <- layer_input(shape = c(ncol(dat.X)))
net <- features % >%
  layer_dense ( units = q , activation = "tanh") % >%
  layer_dense ( units = 1, activation = k_exp )

我希望代码使我成为神经网络模型。

r machine-learning keras neural-network
1个回答
0
投票

我认为您的keras软件包安装不正确,试试这个

library(keras)
install_keras()
© www.soinside.com 2019 - 2024. All rights reserved.