Closed fawda123 closed 9 years ago
@mngreene, this is not a bug but more of a feature request. I'd have to modify the plot code significantly for the plotnet.nnet method... stay tuned.
No didn't think it was a bug - rather was just wondering if you had considered to include support for it.
I will be using the package a bit more in the next few weeks - will try to think of any other features that could improve it.
Regards,
Max
From: Marcus W Beck notifications@github.com Sent: 21 August 2015 15:40 To: fawda123/NeuralNetTools Subject: Re: [NeuralNetTools] plotting error with skip layer models (#12)
Ok, this is not a bug but more of a feature request. I'd have to modify the plot code significantly for the plotnet.nnet method... stay tuned.
Reply to this email directly or view it on GitHubhttps://github.com/fawda123/NeuralNetTools/issues/12#issuecomment-133448214.
Hi @mngreene, I think I've got a working version that can plot skip layer connections. The plotting function now includes an option to plot the skip layer connections separate from the primary network. This is the default if size = 0
in your example. Here's a snippet with some examples:
# devtools::install_github('fawda123/NeuralNetTools')
library(NeuralNetTools)
library(nnet)
ird <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]),
species = factor(c(rep("s",50), rep("c", 50), rep("v", 50))))
# five nodes in hidden layer, no skip
ir.nn1 <- nnet(species ~ ., data = ird, size = 5, rang = 0.1,
decay = 5e-4, maxit = 200, skip = FALSE)
# five nodes in hidden layer, skip
ir.nn2 <- nnet(species ~ ., data = ird, size = 5, rang = 0.1,
decay = 5e-4, maxit = 200, skip = TRUE)
# only a skip layer
ir.nn3 <- nnet(species ~ ., data = ird, size = 0, rang = 0.1,
decay = 5e-4, maxit = 200, skip = TRUE)
# plots
plotnet(ir.nn1)
plotnet(ir.nn2)
plotnet(ir.nn2, skip = TRUE)
plotnet(ir.nn3)
Let me know if you have any problems.
-Marcus
Hi Marcus,
With the code below, if you set the size = 1+, plotting works fine. But if you change it to 0 with skip connections enabled, I get the error instead:
Error in data.frame(wts, row_nms) :
arguments imply differing number of rows: 3, 13)