zoukankan      html  css  js  c++  java
  • TensorFlow使用记录 (十): Pretraining

    上一篇的模型保存和恢复熟练后,我们就可以大量使用 pretrain model 来训练任务了

    Tweaking, Dropping, or Replacing the Upper Layers

    The output layer of the original model should usually be replaced since it is most likely not useful at all for the new task, and it may not even have the right number of outputs for the new task.

    Similarly, the upper hidden layers of the original model are less likely to be as useful as the lower layers, since the high-level features that are most useful for the new task may differ significantly from the ones that were most useful for the original task. You want to find the right number of layers to reuse.

    Try freezing all the copied layers first, then train your model and see how it performs. Then try unfreezing one or two of the top hidden layers to let backpropagation tweak them and see if performance improves. The more training data you have, the more layers you can unfreeze.

    If you still cannot get good performance, and you have little training data, try dropping the top hidden layer(s) and freeze all remaining hidden layers again. You can  iterate until you find the right number of layers to reuse. If you have plenty of training data, you may try replacing the top hidden layers instead of dropping them, and even add more hidden layers.

    Model Zoos

    Where can you find a neural network trained for a task similar to the one you want to tackle? The first place to look is obviously in your own catalog of models. This is one good reason to save all your models and organize them so you can retrieve them later easily. Another option is to search in a model zoo. Many people train Machine Learning models for various tasks and kindly release their pretrained models to the public.

    TensorFlow has its own model zoo available at https://github.com/tensorflow/models. In particular, it contains most of the state-of-the-art image classification nets such as VGG, Inception, and ResNet (see Chapter 13, and check out the models/slim directory), including the code, the pretrained models, and tools to download popular image datasets.

    Another popular model zoo is Caffe’s Model Zoo. It also contains many computer vision models (e.g., LeNet, AlexNet, ZFNet, GoogLeNet, VGGNet, inception) trained on various datasets (e.g., ImageNet, Places Database, CIFAR10, etc.). Saumitro Dasgupta wrote a converter, which is available at https://github.com/ethereon/caffe-tensorflow.

  • 相关阅读:
    安装伪分布的Hadoop时SHUTDOWN_MSG: Shutting down NameNode at xxx并不一定是namenode格式化失败
    ubuntu安装与卸载java
    hadoop之Hive部署
    Hive中生成随机唯一标识ID的方法
    利用sqoop将hive数据导入导出数据到mysql
    利用sqoop将hive数据导入导出数据到mysql
    linux中sqoop实现hive数据导入到mysql
    linux中sqoop部署以及实现mysql数据导入hive
    Altium Designer如何创建类,如何修改线宽
    Altium Designer中画pcb如何隐藏和显示地线
  • 原文地址:https://www.cnblogs.com/xuanyuyt/p/11663946.html
Copyright © 2011-2022 走看看