c++ - Importing weights into opencv MLP? -
say want use other product create mlp (r,python, matlab, whatever) want run network, i.e. prediction, under opencv. assume parameters (e.g. activation function) compatible between training product , opencv.
how can import trained weights opencv mlp? perhaps training product uses mxn matrix of weights each layer m input layer , m output (and w(i,j) weight between input node , output node j.) perhaps biases stored in separate n element vector. specifics of original format don't matter because long know weights mean , how stored can transform them opencv needs them.
so, given that, how import these weights (run time prediction only) opencv mlp? weight bias (etc?) format opencv need , how set weights+baises?
i've run same problem. haven't looked @ opencv's mlp class enough yet know if there's easier/simpler way to, opencv let's save , load mlp's .xmls , .ymls if make ann in opencv, can save 1 of formats, @ figure out format opencv wants, , save network format r/python/matlab or @ least format , make script translate there opencv's format. once have done should simple instantiating opencv's mlp in code want use predict on , calling load("filename") function on it. (i realize year after fact, found answer or work around. if found better idea, tell me, i'd love know).
Comments
Post a Comment