R深度学习,多输出(R deep learning, multiple outputs)

编程入门 行业动态 更新时间:2024-10-27 19:24:20
R深度学习,多输出(R deep learning, multiple outputs)

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

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)

Is it possible to create a deep learning net that gives multiple outputs? The reason for doing this is to also try to capture the relationships between outputs. In the examples given I can only create one output.

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常见问题解答和H2O Google Group主题 )。 他们的建议是为每个响应训练一个新模型。

(荒谬的)例子:

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))

It doesn't look like multiple response columns are currently supported in H2O (H2O FAQ and H2O Google Group topic). Their suggestion is to train a new model for each response.

(Nonsensical) example:

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)

However, it appears that multiple responses are available through the deepnet package (check 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))

更多推荐

本文发布于:2023-08-02 16:06:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1378598.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:深度   deep   learning   multiple   outputs

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!