KERAS应用程序(转移学习)

发布于 2025-01-18 12:33:20 字数 411 浏览 3 评论 0原文

我是一名学生,目前正在自学深度学习。在这里我想请大家澄清一下关于迁移学习的问题。

例如 MobileNetv2 (https://keras.io/api/applications/mobilenet/# mobilenetv2-function),如果权重参数设置为 None,那么我不进行迁移学习,因为权重是随机初始化的。如果我想做迁移学习,那么我应该将权重参数设置为imagenet。这个概念正确吗?

关于深度学习的澄清和解释

I am a student and currently studying deep learning by myself. Here I would like to ask for clarification regarding the transfer learning.

For example MobileNetv2 (https://keras.io/api/applications/mobilenet/#mobilenetv2-function), if the weights parameter is set to None, then I am not doing transfer learning as the weights are random initialized. If I would like to do transfer learning, then I should set the weights parameter to imagenet. Is this concept correct?

Clarification and explanation regarding deep learning

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

追我者格杀勿论 2025-01-25 12:33:20

是的,当您以随机值初始化权重时,您只是在使用架构并从头开始训练模型。转移学习的目的是利用另一种训练有素的模型来获得更好的结果或使用较少的计算资源。

使用转移学习的方法有不同的方法:

  • 您可以冻结基本模型的学习权重,并替换问题上的最后一层,然后只需训练最后一层,
  • 您就可以从学习的权重开始并进行微调(让他们在学习过程中改变)。许多人这样做是因为有时它会使培训更快,并给出更好的结果,因为权重已经包含了很多信息。
  • 您可以使用第一层提取基本功能,例如颜色,边缘,圆圈...并在它们之后添加所需的图层。这样,您可以使用资源来学习高级功能。

还有更多案例,但我希望它可以给您一个主意。

Yes, when you initialize the weights with random values, you are just using the architecture and training the model from scratch. The goal of transfer learning is to use the previously gained knowledge by another trained model to get better results or to use less computational resources.

There are different ways to use transfer learning:

  • You can freeze the learned weights of the base model and replace the last layer of the model base on your problem and just train the last layer
  • You can start with the learned weights and fine-tune them (let them change in the learning process). Many people do that because sometimes it makes the training faster and gives better results because the weights already contain so much information.
  • You can use the first layers to extract basic features like colors, edges, circles... and add your desired layers after them. In this way, you can use your resources to learn high-level features.

There are more cases, but I hope it could give you an idea.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文