-
Notifications
You must be signed in to change notification settings - Fork 108
Transfer Learning in Shifu
Hu Zhanghao edited this page Mar 13, 2020
·
10 revisions
- Run
$ shifu stats
- Run
$ shifu norm
- Run
$ shifu varsel
- Run
$ shifu train
- Change
'basic.name'
toModelB
in ModelConfig.json - See: How to do it in PyShifu
- First of all, change
train.isContinuous
totrue
in ModelConfig.json - Design the model structure - the ModelB's model structure should be larger than ModelA's. See:
The larger means wider , or deeper, or both wider and deeper.
- Add
FixedLayers
intrain.params
, it is a list of layers that you want to freeze Please note, the layers start from 1, 2..., the parameters between input layer and first hidden layer, is defined as layer 1, the parameters between first hidden layer and second hidden layer is defined as layer 2... Example"FixedLayers" : [1, 2]
. See:
- Add
FixedBias
intrain.params
, if you want to freeze the bias also. Example"FixedBias" : true
"baggingNum" : 1,
...
"numTrainEpochs" : 200,
"isContinuous" : true,
"workerThreadCount" : 4,
"algorithm" : "NN",
"params" : {
"Propagation" : "R",
"LearningRate" : 0.1,
"NumHiddenNodes" : [ 50, 10],
"NumHiddenLayers" : 2,
"RegularizedConstant" : 0.0,
"ActivationFunc" : [ "tanh", "tanh" ],
"FixedLayers" : [ 1 ],
"FixedBias" : false
},