alibaba / pipcook

Machine learning platform for Web developers

Home Page:https://alibaba.github.io/pipcook/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Transfer Learning] Pipcook is supposed to support transfer learning with plugin specification

rickycao-qy opened this issue · comments

Pipcook is supposed to standardize how the plugin supports transfer learning.

Currently, we provide an interface for model-define plugin with recoverPath attribute and leaves other works in plugins. The plugin has full freedom to decide how and whether to support transfer learning. This will cause confusion to users and is hard to uniform this ability.

I suggest we should go further to define how to do transfer learning in pipcook and force plugins to follow the standard.

Do you have more thoughts on this. Will look forward to your opinions.

Will all model-define plugins have this param?

Let's list all model-define plugins and see which already has this param

  • @pipcook/plugins-tensorflow-mobilenet-model-define
  • @pipcook/plugins-tensorflow-resnet-model-define
  • @pipcook/plugins-detectron-fasterrcnn-model-define
  • @pipcook/plugins-bayesian-model-define
  • @pipcook/plugins-pytorch-yolov5-model-define
  • @pipcook/plugins-fasttext-model-define
  • @pipcook/plugins-tensorflow-cycle-gan-model-define
  • @pipcook/plugins-detectron-maskrcnn-model-define
  • @pipcook/plugins-tensorflow-bert-ner-model-define
  • @pipcook/plugins-tfjs-simplecnn-model-define
  • @pipcook/plugins-tfjs-text-lstm-model-define
  • @pipcook/plugins-tfjs-text-lstm-model-define

@rickycao-qy please check

For me currently, I can image serval params that maybe helpful in transfer learning.

  • recoverPath
    • as mentioned above, specified the directory which contains the "model" directory
    • which can be found in the output
  • freeze (fine-tuning)
    • whether to freeze first several layers
    • currently a boolean flag, not sure if we can make this an integer, to specify how many layers to freeze
    • 0 could mean not to freeze
  • learningRate
    • base learning rate
    • currently also named "baseLearningRate" in some plugins
  • labelMap
    • a string yo string map(object), to descption the describe the mapping relations for new labels
    • not necessary
  • epochs (currently defined in model-train plugins)
    • how many epochs will train for current job
  • maxEpoch (could be in model-train plugins also)
    • job will be stopped when it reaches maxEpoch

Will all model-define plugins have this param?

It's likely some of models cannot support transfer learning. We can think of a way that Pipcook could be infomred which one support and which one does not support

For me currently, I can image serval params that maybe helpful in transfer learning.

  • recoverPath

    • as mentioned above, specified the directory which contains the "model" directory
    • which can be found in the output
  • freeze

    • whether to freeze first several layers
    • currently a boolean flag, not sure if we can make this an integer, to specify how many layers to freeze
    • 0 could mean not to freeze
  • labelMap

    • a string yo string map(object), to descption the describe the mapping relations for new labels
    • not necessary
  • epochs (currently defined in model-train plugins)

    • how many epochs will train for current job
  • maxEpoch (could be in model-train plugins also)

    • job will be stopped when it reaches maxEpoch

That sounds good. We need to split which methods are used in model-define and which methods are used in model-train. I guess model-train do not need to know whether currently it's transfer learning or new-model learning.

"freeze (fine-tuning)" params also reminds me that, maybe we need some extra params in "model-define" plugins.
That will make the conception of "layer" complete : )