title: detailed output for nnet function in R
body: <p>I am using the <code>nnet</code> function from the <code>nnet</code> package in R to develop a feed-forward multilayer neural network.  I am interested in obtaining more detailed output of the prediction error associated with the output after each training iteration.  Setting the trace argument as TRUE (default) will give me the prediction error after each set of ten training iterations.  However, I'd like to get the prediction error after every iteration rather than after each set of ten. </p>
  
  <p>Using a modified portion of the example code from the help file shows the initial prediction error, the prediction error after 10, 20, etc. iterations and the final prediction error after the maximum number of iterations is reached:</p>
  
  <pre><code>data(iris)     
  ir &lt;- rbind(iris3[,,1],iris3[,,2],iris3[,,3])
  targets &lt;- class.ind( c(rep("s", 50), rep("c", 50), rep("v", 50)) )
  samp &lt;- c(sample(1:50,25), sample(51:100,25), sample(101:150,25))
  ir1 &lt;- nnet(ir[samp,], targets[samp,], size = 2, rang = 0.1,
                   decay = 5e-4, maxit = 50)
  </code></pre>
  
  <p>The output:</p>
  
  <pre><code># weights:  19
  initial  value 55.824151 
  iter  10 value 49.096486
  iter  20 value 37.871175
  iter  30 value 25.536477
  iter  40 value 1.498461
  iter  50 value 0.954119
  final  value 0.954119 
  stopped after 50 iterations
  </code></pre>
  
  <p>Using a workaround, I can get the error after each training iteration:</p>
  
  <pre><code>errors&lt;-NULL
  for(i in 1:50){
    set.seed(50)
    mod&lt;-nnet(ir[samp,], targets[samp,], size = 2, rang = 0.1,
             decay = 5e-4, maxit = i)
    errors&lt;-rbind(errors,c(i,mod$value))         
    }
  </code></pre>
  
  <p>For obvious reasons, the workaround is very inefficient and I am wondering if its possible to tweak the source code to return the error after each training iteration rather than after each set of ten training iterations.  I've tried tweaking the code for nnet.default but have had no such luck.  </p>
  
  <p>Thanks in advance.</p>