Adaptation do not work
I'm trying to apply model adaptation using KLD regularization using CNTK. Seems this feature does not work currently. Here is my config file for model adaptation. BLSTM-MultiTask=[ action=adapt origModelFileName="$OutputDir$/Models_average/VC_MT_AV.dnn" refNodeName=ObjFcn.O Truncated=false modelPath = "$ModelDir$/VC_MTL.dnn" adaptationRegType=KL adaptationRegWeight=0.8
................... ]
According to problems reported in issue252 , I modify the config file and SGD.cpp file in the suggestion. Then, another error occurred:
Starting minibatch loop. getbatch: getting utterances 65..65 (1116 subset of 1116 frames out of 64 requested) in sweep 0 getbatch: getting utterances 66..66 (892 subset of 892 frames out of 64 requested) in sweep 0 getbatch: getting utterances 67..67 (685 subset of 685 frames out of 64 requested) in sweep 0 getbatch: getting utterances 68..68 (948 subset of 948 frames out of 64 requested) in sweep 0 getbatch: getting utterances 69..69 (1714 subset of 1714 frames out of 64 requested) in sweep 0 getbatch: getting utterances 70..70 (767 subset of 767 frames out of 64 requested) in sweep 0 getbatch: getting utterances 71..71 (1205 subset of 1205 frames out of 64 requested) in sweep 0 getbatch: getting utterances 72..72 (1028 subset of 1028 frames out of 64 requested) in sweep 0 getbatch: getting utterances 73..73 (966 subset of 966 frames out of 64 requested) in sweep 0 getbatch: getting utterances 74..74 (836 subset of 836 frames out of 64 requested) in sweep 0 getbatch: getting utterances 75..75 (901 subset of 901 frames out of 64 requested) in sweep 0 Segmentation fault (core dumped)
There is no example for model adaptation in the official documents. Any one have the experience for model adaptation can help?
This is indeed not working, since its original implementation used a hack that was incompatible with some larger architectural changes we had made. KL-regularized adaptation is being revamped currently.
The new version will work very differently--you would use BrainScriptNetworkBuilder to create an extended network that contains a read-only copy of the original network, and use that to compute the soft labels to realize the KL-regularized CE criterion.
This link has a sketch at the end on what this would look like. However, I have not been able to test this yet.
Would you like to give it a try? I'd be more than happy to work out possible errors in the example with you. You will need a binary built from master source as of yesterday.
Hi @frankseide , thank you very much for the information! I would like to try it, but I can not open the link you provide.
Hi @frankseide I would also like to try Adaptation. But as @minghuaiping says the link is broken.
Sorry, I updated the link above. It should be this: [[https://github.com/Microsoft/CNTK/wiki/CloneFunction]]
Hi @frankseide , Here is my configuration:
BLSTM-MultiTask=[
action="adapt"
BrainScriptNetworkBuilder = (new ComputationNetwork
include "$ConfigDir$/DefaultMacros.bs"
include "$ConfigDir$/mtl_blstm.bs"
)
network=BS.Network.Load("$OutputDir$/Models_average/VC_MT_AV.dnn")
# STEP 2: extract a read-only section that is the feature extractor function
adptNet = CloneFunction (network.features, [ z = network.z] ,parameters="learnable")
refNet = CloneFunction (network.features, [ z = network.z ], parameters="constant")
z = adaptNet (features).z
zRef = refNet (features).z
maxEpochs=512
Truncated=false
#Truncated=true
modelPath = "$ModelDir$/VC_MTL.dnn"
adaptationRegType=KL
adaptationRegWeight=0.8
...... ]
Then the follow error occurred.
reading script file ../Data/neut_develop.scp ... 14 entries reading script file ../Data/angr_develop.scp ... 14 entries reading script file ../Data/disg_develop.scp ... 14 entries reading script file ../Data/fear_develop.scp ... 14 entries reading script file ../Data/happ_develop.scp ... 14 entries reading script file ../Data/sadn_develop.scp ... 14 entries reading script file ../Data/surp_develop.scp ... 14 entries ..............feature set 0: 15088 frames in 14 out of 14 utterances minibatchutterancesource: 14 utterances grouped into 1 chunks, av. chunk size: 14.0 utterances, 15088.0 frames ..............feature set 1: 15088 frames in 14 out of 14 utterances minibatchutterancesource: 14 utterances grouped into 1 chunks, av. chunk size: 14.0 utterances, 15088.0 frames ..............feature set 2: 15088 frames in 14 out of 14 utterances minibatchutterancesource: 14 utterances grouped into 1 chunks, av. chunk size: 14.0 utterances, 15088.0 frames ..............feature set 3: 15088 frames in 14 out of 14 utterances minibatchutterancesource: 14 utterances grouped into 1 chunks, av. chunk size: 14.0 utterances, 15088.0 frames ..............feature set 4: 15088 frames in 14 out of 14 utterances minibatchutterancesource: 14 utterances grouped into 1 chunks, av. chunk size: 14.0 utterances, 15088.0 frames ..............feature set 5: 15088 frames in 14 out of 14 utterances minibatchutterancesource: 14 utterances grouped into 1 chunks, av. chunk size: 14.0 utterances, 15088.0 frames ..............feature set 6: 15088 frames in 14 out of 14 utterances minibatchutterancesource: 14 utterances grouped into 1 chunks, av. chunk size: 14.0 utterances, 15088.0 frames Load Network From the original model file .
[CALL STACK]
[0x7f0cf259dcb0] Microsoft::MSR::CNTK::File:: Init (wchar_t const_, int) + 0x600
[0x7f0cf259e00f] Microsoft::MSR::CNTK::File:: File (std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>> const&, int) + 0x1f
[0x7c59ec] void Microsoft::MSR::CNTK::ComputationNetwork:: Read
EXCEPTION occurred: File: filename is empty
This issue has been dormant for a long while, please check out the latest CNTK release. If you still run into problems, please open a new issue.