saving & loading NeuralNet model
See original GitHub issuehi matt & henning,
so i managed to use tagger.py
from the examples directory with some easy patch (using train_sparse
and predict_sparse
directly), but i don’t know how to save and load the trained model. i’ve tried to re-initialised the tagger.model and set the weights but the final result is too random (i’m guessing re-init causing the model set to default/random).
In [2]: tagger, w, c = pickle.load(open('models/UD_Indonesian/model.bin'))
In [3]: tagger.model = NeuralNet([tagger.ex.input_length] + [tagger.hidden_width] * tagger.depth + [len(tagger.classes)], embed=(tagger.ex.tables, tagger.ex.slots), rho=tagger.L2, eta=tagger.learn_rate, update_step=tagger.solver)
In [4]: tagger.model.weights = w
thanks!
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to Save and Load Your Keras Deep Learning Model
In this post, you will discover how to save your Keras models to files and load them up again to make predictions. After...
Read more >Save and load models | TensorFlow Core
Model progress can be saved during and after training. This means a model can resume where it left off and avoid long training...
Read more >Training, saving and loading Artificial Neural Networks in Keras
We demonstrate how to code a Artificial neural network model and train and save it in JSON or H5 format which can be...
Read more >Saving and Loading Models - Deeplearning4j
Saving and loading of neural networks. ... Utility class suited to save/restore neural net models. writeModel. public static void writeModel(@NonNull Model ...
Read more >Save and Load a Model with TensorFlow's Keras API
... the various ways of saving and loading a Sequential model using TensorFlow's Keras API. ... TensorFlow - Python Deep Learning Neural Network...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Neural network is finally live 😃.
The new code is much simpler and better, and supports pickle — so serialisation is now no problem.
I think youre clipping the value in that
__set__
method —weight_t
isdouble
in recent versions, so be careful to use the typedef.