New to machine learning? Watch a video course to get practical working knowledge of ML using web technologies
View series
什么是迁移学习?
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
复杂的深度学习模型有数百万个参数(权重),从头训练这些模型通常需要大量数据和计算资源。迁移学习会在新模型中重复使用已在相关任务上训练过的模型的一部分,可以显著降低这些需求。
例如,本部分中的下一个教程将向您展示如何自行构建图像识别器来利用一个已训练的模型识别图像中的 1000 种不同类型的物体。您可以利用预训练模型中的已有知识来检测您自己的图像类,训练数据会比原始模型所需的数据少得多。
在快速开发新模型,以及在浏览器和移动设备等资源受限环境中自定义模型时,这样做非常有用。
进行迁移学习时,我们通常不调整原始模型的权重,而是移除最后一层,并基于截断模型的输出训练一个新的(通常相当浅的)模型。这就是您将在本部分的教程中看到的技术。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2021-08-16。
[null,null,["最后更新时间 (UTC):2021-08-16。"],[],[],null,["# What is transfer learning?\n\n\u003cbr /\u003e\n\nSophisticated deep learning models have millions of parameters (weights), and\ntraining them from scratch often requires large amounts of data and computing\nresources. Transfer learning is a technique that shortcuts much of this by\ntaking a piece of a model that has already been trained on a related task and\nreusing it in a new model.\n\nFor example, the next tutorial in this section will show you how to build your\nown image recognizer that takes advantage of a model that was already trained to\nrecognize 1000s of different kinds of objects within images. You can adapt the\nexisting knowledge in the pre-trained model to detect your own image classes\nusing much less training data than the original model required.\n\nThis is useful for rapidly developing new models as well as customizing models\nin resource-constrained environments like browsers and mobile devices.\n\nMost often when doing transfer learning, we don't adjust the weights of the\noriginal model. Instead we remove the final layer and train a new (often fairly\nshallow) model on top of the output of the truncated model. This is the\ntechnique you will see demonstrated in the tutorials in this section:\n\n- [Build a transfer-learning based image classifier](/js/tutorials/transfer/image_classification)\n- [Build a transfer-learning based audio recognizer](/js/tutorials/transfer/audio_recognizer)\n\nFor an additional example of transfer learning using TensorFlow.js, see\n[Use a pre-trained model](/js/tutorials/conversion/pretrained_model)."]]