Online Forum

What's next after training a network?  

  RSS

(@harryjenkins)
New Member
Joined:8 months  ago
Posts: 1
24/03/2018 2:25 pm  

Hello,

It's been about a year now since I began and so far I have quite understanding of how neural networks are made and function. So far I know how to feedforward, backpropagate, and train the network. Now it seems as I am stuck in the next process. That is, I want to learn how after I have trained a network I can predict the next output based in data that was already learned. Just wondering if anyone can guide me towards the right direction for this. I am familiar with Python and Java, not so much in C.
Mostly, I am looking to learn the next mathematical algorithm in predicting an output. Is statistics involved in this?

Please help.

I did not find the right solution from the internet.

References:-

http://www.ai-forum.org/topic.asp?forum_id=1&topic_id=79017

Best Internet Marketing Examples

Thanks


ReplyQuote
(@menway)
New Member
Joined:6 months  ago
Posts: 1
10/05/2018 7:09 pm  

Hi harryjenkins,

Firstly, you need to save the trained weights to a model file on your hard disk. By default, the weights are stored in memory during the training process, once you exit the training, the weights are gone. So you must explicitly call the "save model" API in your training program at a certain time point, e.g., for each epoch, for every 10 epochs, when the maximum accuracy is met, when the minimum loss is met, etc.

What deep learning framework are you using? If you are familiar with tensorflow, check this official document for saving models.

Save and Restore  |  TensorFlow
https://www.tensorflow.org/programmers_guide/saved_model

 

When you have the model file, you can proceed to write a prediction program. In the prediction program, you need [1] get the input data (e.g. an image file to classify); [2] pre-processing the input data (same as training: resizing, normalization, etc); [3] load the model file and restore the trained network; [4] feed the processed data into the network; [5] extract the prediction results from the output layer.

 

Here is a tutorial for recognizing handwriting digits using tensorflow and MNIST dataset.
https://niektemme.com/2016/02/21/tensorflow-handwriting/

 

And here is the prediction program in the tutorial. You can take a look at it and try to implement your own prediction program.

https://github.com/niektemme/tensorflow-mnist-predict/blob/master/predict_1.py

 

If you have any questions, please leave a reply.

 

Regards,

Menway


ReplyQuote
  
Working

Please Login or Register