更新时间:2021-09-18 GMT+08:00
分享

配置文件

当前提供的算子开发界面,功能尚未完善。高阶功能,需要通过编辑配置文件“custom.template.json”实现。

配置文件“custom/config/custom.template.json”的结构,如下所示:

{
  "i18n": {
    "zh": {
        "learnware_fcn_data_preprocessing": "数据预处理",
    },
    "en": {
        "learnware_fcn_data_preprocessing": "Data Pre-processing"
    }
  },
  "operators": [
    {
      "id": "learnware_fcn",
      "icon": "/static/lab/725116af93f13fcc267001ad4c7d3ff3.png",
      "label": "多层嵌套异常检测学件",
      "items": [
          {
          "id": "learnware_fcn_data_pre_processing",
          "icon": "/static/lab/817c016c3910de58e07659426bf40f4d.png",
          "label": "${i18n.learnware_fcn_data_preprocessing}",
          "actions": {
            "id": "learnware-fcn:data_preprocessing",
            "type": "learnware_fcn_data_pre_processing",
            "items": [
              {
                "type": 0,
                "content": "## ${i18n.learnware_fcn_data_preprocessing}"
              },
              {
                "type": 1,
                "content": "from naie.learnware.fcn.preprocess import trans_data\ncol_value = 'value'  #@param {\"type\":\"string\",\"label\":\"指标列\"}\ncol_label =   'is_anomaly' #@param {\"type\":\"string\",\"label\":\"标签列\"}\nmode = 'train'#@param {\"type\":\"string\",\"label\":\"数据处理模式\",\"radios\":[{\"text\":\"训练\",\"value\":\"train\"},{\"text\":\"测试\",\"value\":\"test\"}]}\ntrain_data = trans_data(datareference,col_value='value',col_label='is_anomaly',mode=mode)"
              }
            ]
          }
        }
      ]
    }
  ],
  "formConfig": [],
  "recommendations": {
    "learnware_fcn_data_pre_processing": [
      "learnware_fcn_model_training",
      "learnware_fcn_model_test"
    ]
  },
  "restrictions": {
    "operators": ["learnware-init", "learnware_fcn_data_pre_processing"],
    "restrictions": [{
      "id": "learnware-init",
      "first": true,
      "maxInstanceNum": 1
    }]
  }
}

图片暂时不支持动态注册,算子的图标目前只能从平台预置图标中选择。

参数说明如下所示:

  • operators:算子配置,详情请参见表1
  • formConfig:表单配置,详情请参见表1
  • recommendations:算子推荐关系配置,详情请参见算子推荐列表配置
  • restrictions:算子约束关系配置,详情请参见算子约束配置
分享:

    相关文档

    相关产品

close