[mlpack-git] [mlpack/mlpack] Spill trees (#747)

Ryan Curtin notifications at github.com
Sun Aug 14 16:45:09 EDT 2016

> @@ -249,6 +318,9 @@ void NSModel<SortPolicy>::Serialize(Archive& ar,
>                                      const unsigned int /* version */)
>  {
>    ar & data::CreateNVP(treeType, "treeType");
> +  ar & data::CreateNVP(leafSize, "leafSize");
> +  ar & data::CreateNVP(tau, "tau");
> +  ar & data::CreateNVP(rho, "rho");

I hate to always be talking about reverse compatibility, but this is reverse-incompatible, since tau, rho, and leafSize aren't part of the previous saved models.  So the thing to do is to uncomment the `version` parameter, and use `version == 0` to assume that leafSize, tau, and rho aren't available (and set them to defaults), and `version == 1` to assume that leafSize, tau, and rho are available.

You'll need to then set the serialization version.  For `LSHSearch`, that's done like this:


//! Set the serialization version of the LSHSearch class.
BOOST_TEMPLATE_CLASS_VERSION(template<typename SortPolicy>,
    mlpack::neighbor::LSHSearch<SortPolicy>, 1);

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160814/839f6ec7/attachment.html>

More information about the mlpack-git mailing list