Hi,
I would like to have the functionality of the python Pickle package, in that I would like to easily store the value of a custom structure, so that it could easily be loaded up into a new package.
My custom structure looks like
and in the main file, I call a function Train which returns a pointer to a Net. I would like to save this output. Trying to use Gob in the outer code,
http://play.golang.org/p/7ZQNPdxDl7, I get a runtime error that Gob doesn't know how to deal with the Loss function "gob NewTypeObject can't handle type: func([]float64, []float64) (float64, []float64)"
I believe I need to use the GobEncoder / GobDecoder interfaces, but I'm not sure how to represent my type as a slice of bytes. I've looked at
http://blog.golang.org/2011/03/gobs-of-data.html but it didn't seem to help. Is it that I can't represent the Loss function type at all? Is there a better way of doing this?
Thanks