I need help with saving my neural network.
I'll explain...i programmed multi-layer network in C#..the part of application is for training and the other part is for testing neural network. Everything works exactly as it should. When i want to train my network i load a set of data from a file. When the training is over i test it on a smaller sample of data and it gives me correct output. But now i would like to be able to train my network and save it, so that i can load it again and use it for further testing.
I will assume you have your machine learning class called Bayes
(or whatever). Typically you would mark this as [Serializable]
using System.IO;
[Serializable]
public class NaiveBayes
{
...
}
In this class you could then have a method to do your saving
public void Save(Stream stream)
{
YourBinaryFormatter b = new YourBinaryFormatter();
b.Serialize(stream, this);
}
YourBinarySerializer
here is just some serializer of your choice, you can use another serializer if you wish. Reading these files is the reverse and is equally as easy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With