[mlpack-git] [mlpack] ANN Saving the network and reloading (#531)

stereomatchingkiss notifications at github.com
Tue Mar 1 09:39:44 EST 2016


>If the serialization hasn't completed yet, what does the data stored in the test XML file represent

It is the parameters of ann, but I think it still lack the weights of another layers.

>And once the serialization is finished, what details will be stored in the XML file? 

It should store the parameters of the cnn,ffn,rnn and other layer weights(I may wrong on this one since I haven't tested it yet)

>If not, I'm still not a 100% sure how to specify the type of network to load when the type is decided just before saving it.

You need to remember what kind of network you build,  Following part are the "type" of network of yours

/```
/ input layer
    ann::LinearLayer<> inputLayer(trainData.n_rows, hiddenLayerSize);
    ann::BiasLayer<> inputBiasLayer(hiddenLayerSize);
    ann::BaseLayer<PerformanceFunction> inputBaseLayer;

    // hidden layer
    ann::LinearLayer<> hiddenLayer1(hiddenLayerSize, trainLabels.n_rows);
    ann::BiasLayer<> hiddenBiasLayer1(trainLabels.n_rows);
    ann::BaseLayer<PerformanceFunction> outputLayer;

    // output layer
    OutputLayerType classOutputLayer;

    auto modules = std::tie(inputLayer, inputBiasLayer, inputBaseLayer, hiddenLayer1, hiddenBiasLayer1, outputLayer);
    ann::FFN<decltype(modules), decltype(classOutputLayer), ann::RandomInitialization, PerformanceFunctionType> net(modules, classOutputLayer);

```

After you train the net, you can save the parameters and load it with same type(the FFN build by your codes), it has to be the original network you use to train the network, part of the parameters could be different(it depends). Unless the parameters about the features of the input data should be the same.

ps : please correct me if anything wrong.

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/531#issuecomment-190746299
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160301/335388d4/attachment-0001.html>


More information about the mlpack-git mailing list