title: Is there a way to set up a multi-hidden layer neural network with the mlp method in the caret package?
body: <p>The <code>mlp</code> method in package <a href="http://cran.r-project.org/web/packages/caret/index.html" rel="noreferrer"><code>caret</code></a> calls the <code>mlp</code> function in <a href="http://cran.r-project.org/web/packages/RSNNS/index.html" rel="noreferrer"><code>RSNNS</code></a>. In the <code>RSNNS</code> package, I can set up as many hidden layers in the neural net as I like by setting the size parameter, e.g.</p>
  
  <pre><code>data(iris)
  
  #shuffle the vector
  iris &lt;- iris[sample(1:nrow(iris),length(1:nrow(iris))),1:ncol(iris)]
  
  irisValues &lt;- iris[,1:4]
  irisTargets &lt;- decodeClassLabels(iris[,5])
  #irisTargets &lt;- decodeClassLabels(iris[,5], valTrue=0.9, valFalse=0.1)
  
  iris &lt;- splitForTrainingAndTest(irisValues, irisTargets, ratio=0.15)
  iris &lt;- normTrainingAndTestSet(iris)
  
  model &lt;- mlp(iris$inputsTrain, iris$targetsTrain, size=c(5,7), learnFuncParams=c(0.1), 
               maxit=50, inputsTest=iris$inputsTest, targetsTest=iris$targetsTest)
  </code></pre>
  
  <p>Will set up a neural net with two hidden layers of 5 and 7 nodes respectively. I want to use the <code>caret</code> package because it has functionality for doing parameter/model searches, as well as parallel implementations for a cluster. In <code>caret</code>, when I look up the method, it can only be tuned with one parameter, <code>size</code>, e.g.</p>
  
  <pre><code>data(iris)
  
  mlpGrid &lt;- data.frame(.size=3)
  model2&lt;-caret::train(Species~. , iris, method='mlp', tuneGrid=mlpGrid)
  </code></pre>
  
  <p>Sets up a neural net with a 3-node single hidden layer.</p>
  
  <p>I've tried adding other columns to <code>mlpGrid</code> and such, but <code>caret</code> doesn't seem to allow for adding a second (or more) hidden layer.</p>