Uploaded image for project: 'Singa'
  1. Singa
  2. SINGA-61

Support user defined classes

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None

    Description

      Many modules in SINGA are extensible. To make it easy for users to implement their own classes, SINGA separates user code and SINGA code. Users just compile their code and link it with libsinga.so. One problem in this design is on the configuration. Take the Layer configuration as an example。

      enum LayerType{
        kFoo = 2;
        ...
      }
      message LayerProto {
        required LayerType type = 2;
      }
      

      The types of all built-in layers are defined in enum LayerType. However, for user defined Layer sub-classes, users cannot add them into LayerType without recompiling SINGA code (google protocol buffer does not support extension of enum types).

      To solve this problem, SINGA needs one field for user defined Layer sub-classes.

      message LayerProto {
        optional LayerType type =2;
        optional string user_type = 3;
      }
      

      In user's job configuration file, he either sets type ( for built-in layer) or set user_type (for user defined layer).

      It is similar for other classes, e.g., Worker, Updater, etc.

      Attachments

        Activity

          People

            Unassigned Unassigned
            wangwei.cs wangwei
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: