2
$\begingroup$

Let's say I have written a NetChain machine learning setup, trained the chain with NetTrain and obtained a model ready to predict:

model = NetChain[...];
trained = NetTrain[model,...];

The whole process took a long time to prepare, so I do not want to repeat the same preparation steps the next time I start Mathematica. Is there a way to save trained and load from memory instead of recreating it?

$\endgroup$
1
  • 1
    $\begingroup$ Pretty sure you can just save it via the normal routes, e.g. .m, .mx, compressed string, byte array. $\endgroup$
    – b3m2a1
    Commented Sep 4, 2017 at 5:10

1 Answer 1

8
$\begingroup$

Export[NotebookDirectory[]<>"mynet.wlnet",trained]

Just use Import on the same file to reload into memory.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.