Yes, it worked. I used this class to save the model state:
[Serializable]
struct SerializationObject
{
public int nClass;
public int nFeatures;
public double noisePrec;
public VectorGaussian[] wInitTrainModel;
}
Serialization is:
SerializationObject s;
s.nClass = nClass;
s.nFeatures = totalFeatures;
s.noisePrec = noisePrec;
s.wInitTrainModel = bpmIncremental.TrainedModel.wInit;
SerializeObject(s); //binary serialization
Deserialization code is:
SerializationObject d = DeSerializeObject(model);
noisePrec = d.noisePrec;
totalFeatures = d.nFeatures;
nClass = d.nClass;
bpmIncremental = new BPM(nClass, totalFeatures, noisePrec);
bpmIncremental.TrainedModel.wInit = d.wInitTrainModel;
You can actually add Save/Load model methods in the future.
I have compiled BPM to an assembly that can be used as if it was unmanaged C++ DLL. This way I was able to incorporated BPM in a C++ application for BCI (Brain Computer Interface). Now some testing is needed :)
-Anton