Menu

SOM Deserialization on CLI causing issue

Help
2015-07-26
2015-07-27
  • Todd Morrison

    Todd Morrison - 2015-07-26

    After serializing a trained SOM (tofile), then deserializing (fromfile), the error "train has not been called" is thrown from GTransform.

    There are a few TODO's floating around Trainer Strategy serialization.
    Is this feature known to be working?

    If not, could you give some guidance on the next steps to get test cases for that in the code base?

    Thanks for your hard work!
    Todd

     
  • Mike Gashler

    Mike Gashler - 2015-07-26

    Thanks for letting us know! I think the correct fix is:

    change src/GClasses/GSelfOrganizingMap.cpp line 812 from
          GDomNode* pNode = pDoc->newObj();
    to
          GDomNode* pNode = baseDomNode(pDoc, "GSelfOrganizingMap");
    and change src/GClasses/GSelfOrganizingMap.cpp line 825 from
        GSelfOrganizingMap::GSelfOrganizingMap(GDomNode* pNode){
    to
        GSelfOrganizingMap::GSelfOrganizingMap(GDomNode* pNode, GLearnerLoader& ll) : GIncrementalTransform(pNode, ll) {
    and change src/GClasses/GSelfOrganizingMap.h line 784 from
          GSelfOrganizingMap(GDomNode* pNode);
    to
          GSelfOrganizingMap(GDomNode* pNode, GLearnerLoader& ll);
    and change src/dimred/main.cpp line 1136 from
        som.reset(new GSelfOrganizingMap(source.root(), ll));
    to
        GLearnerLoader ll;
        som.reset(new GSelfOrganizingMap(source.root(), ll));
    and change src/plot/main.cpp line 1247 from
      GSelfOrganizingMap som(doc.root());
    to
      GLearnerLoader ll;
      GSelfOrganizingMap som(doc.root(), ll);
    

    Does that make it work for your test case? We should probably also add a unit test that does whatever you did to expose this issue.

     
  • Todd Morrison

    Todd Morrison - 2015-07-26

    This is a great lead.

    I'll investigate a patch and submit. I'm still relatively new to your code base but will extend as soon as I get caught up.

    +1 for Github Pull Requests :)

     
  • Anonymous

    Anonymous - 2015-07-26

    Those changes worked like a charm.
    I'll find some time in the upcoming week to crank out some unit tests.

    Thank you for the hard work on this project.
    So far, it is performing extremely well.

     
  • Mike Gashler

    Mike Gashler - 2015-07-27

    Great! Thanks so much for reporting this and testing the fix! I've checked in those changes, now.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.