gpt4 book ai didi

R深度学习,多输出

转载 作者:行者123 更新时间:2023-12-02 01:38:44 26 4
gpt4 key购买 nike

是否可以创建一个提供多个输出的深度学习网络?这样做的原因也是为了尝试捕捉输出之间的关系。在给出的示例中,我只能创建一个输出。

library(h2o)
localH2O = h2o.init()
irisPath = system.file("extdata", "iris.csv", package = "h2o")
iris.hex = h2o.importFile(localH2O, path = irisPath)
h2o.deeplearning(x = 1:4, y = 5, data = iris.hex, activation = "Tanh",
hidden = c(10, 10), epochs = 5)

最佳答案

H2O 目前似乎不支持多响应列(H2O FAQH2O Google Group topic)。他们的建议是为每个响应训练一个新模型。

(无意义的)示例:

library(h2o)
localH2O <- h2o.init()
irisPath <- system.file("extdata", "iris.csv", package = "h2o")
iris.hex <- h2o.importFile(localH2O, path = irisPath)

m1 <- h2o.deeplearning(x = 1:2, y = 3, data = iris.hex, activation = "Tanh",
hidden = c(10, 10), epochs = 5, classification = FALSE)
m2 <- h2o.deeplearning(x = 1:2, y = 4, data = iris.hex, activation = "Tanh",
hidden = c(10, 10), epochs = 5, classification = FALSE)

但是,似乎可以通过 deepnet 获得多个响应。包(检查 library(sos); findFn("deep learning"))。

library(deepnet)
x <- as.matrix(iris[,1:2])
y <- as.matrix(iris[,3:4])
m3 <- dbn.dnn.train(x = x, y = y, hidden = c(5,5))

关于R深度学习,多输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29603624/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com