You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/08/07 08:46:27 UTC

[GitHub] train-test-laura opened a new issue #7364: MxnetR chunk-wise neural nets

train-test-laura opened a new issue #7364: MxnetR chunk-wise neural nets
URL: https://github.com/apache/incubator-mxnet/issues/7364
 
 
   Dear all,
   
   I just now started using the mxnet R package in Windows. 
   
   I have a pretty big dataset which I need to process in chunks due to memory limits. Therefore, I split my dataset and wanted to run a feed-forward  neural net on chunk 1, and use the parameters (weights and bias) for chunk 2 , which in turn can be used for chunk 3, and so on. However, despite some examples [](https://statist-bhfz.github.io/cats_dogs_finetune) I cannot get that to work.
   
   My model looks like that:
   `## set up neural network
   data <- mx.symbol.Variable("data")
   fc1 <- mx.symbol.FullyConnected(data, name="fc1", num_hidden=150)
   act1 <- mx.symbol.Activation(fc1, name="relu1", act_type="relu")
   fc2 <- mx.symbol.FullyConnected(act1, name="fc2", num_hidden=100)
   softmax <- mx.symbol.SoftmaxOutput(fc2, name="sm")
   
   prefix='Checkpoints/chkpt'
   ## train!
   system.time(model <- mx.model.FeedForward.create(softmax, X=train.x, y=train.y,
                                                    ctx=devices, num.round=20, array.batch.size=200,
                                                    learning.rate=0.09, momentum=0.9,  eval.metric=mx.metric.accuracy,
                                                    optimizer='sgd', 
                                                    epoch.end.callback=mx.callback.save.checkpoint(prefix),
                                                    batch.end.callback=mx.callback.log.speedometer(200, frequency = 200)))
   
   `
   and now I tried to follow other posts and used 
   net001<- mx.model.load(prefix, iteration=20)
   
   symbol<- net001$symbol
   internals<- symbol$get.internals()
   outputs<- internals$outputs
   
   arg_params_batch1<- net001$arg.params
   fc1_weights_batch1<- arg_params_batch1[["fc1_weight"]]
   fc2_weights_batch1<- arg_params_batch1i[["fc2_weight"]]
   
   But now I am unsure how to use the weights and bias for the next batch of mx.model.FeedForward.create. 
   Any hint would be greatly appreciated.
   Thank you,
   Best, Laura
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services