Implement transfer learning on niftynet

泪湿孤枕 提交于 2019-12-07 06:54:27

Transfer learning has been added been added to NiftyNet.

You can select which variables you want to restore through the vars_to_restore config parameter and which variables to freeze through the vars_to_freeze config parameter.

See here for more information.

A simple transfer learning can be achieved with restoring weights from existing model in the way that you set the parameter starting_iter in [TRAINING] section of your config file to the number of pretrained model. In your example starting_iter=3000.

This will restore the weights from your model and new iterations will start with this initialisation.

Here the architecture of your model has to be exactly the same, otherwise you will get an error.

For more sophisticated transfer learning or maybe also fine tunning where you can restore only a part of weights, there is a great implementation here. It will be probably merged with official niftynet repository very soon, but you can already use it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!