zoukankan      html  css  js  c++  java
  • Fine Tuning

    (转载自:WikiPedia)

    Fine tuning is a process to take a network model that has already been trained for a given task, and make it perform a second similar task.

    Assuming the original task is similar to the new task, using a network that has already been designed & trained allows us to take advantage of the feature extraction that happens in the front layers of the network without developing that feature extraction network from scratch. Fine tuning:

    • Replaces the output layer, originally trained to recognize (in the case of imagenet models) 1,000 classes, with a layer that recognizes the number of classes you require
    • The new output layer that is attached to the model is then trained to take the lower level features from the front of the network and map them to the desired output classes, using SGD
    • Once this has been done, other late layers in the model can be set as 'trainable=True' so that in further SGD epochs their weights can be fine-tuned for the new task too.

    More detail here.

    With respect to the cats vs dogs example:

    • The original task would be classifying the images into the 1000s of Imagenet categories.
    • The new task would be to classify the images into just 2 categories i.e., cats or dogs.
    • From the definition of finetune, the last layer is removed/popped.
    • Trainable is set to false for all other lower layers as they have already been trained (as part of the original task)
    • In order for the trainable false to take effect, the model needs to be compiled again, as per the last line in the vgg16.finetune() function.
  • 相关阅读:
    备份恢复八大核心
    ORACLE CentOS5.6安装
    ORA-00205
    sf02_选择排序算法Java与Python实现
    解决SQL命令行回退的问题
    redhat 6.4 yum 本地配置简记
    ORA-12705: Cannot access NLS data files or invalid environment specified
    asmca无法创建ASM磁盘
    Sort List
    Merge k Sorted Lists
  • 原文地址:https://www.cnblogs.com/hizhaolei/p/10040121.html
Copyright © 2011-2022 走看看