Learning to Generalize:Meta-Learning for Domain Geralization 深度理解(公式详细推导,包含二阶导)

1.算法整体流程

输入:训练域为: S S S

初始化:模型参数 θ \theta θ,学习率: β , γ \beta,\gamma β,γ

for ite in iterations do

​ Split: S ˉ \bar{S} Sˉ and S ˇ \check{S} Sˇ → \rightarrow S S S

Meta-train:

​ Gradients ∇ θ 1 = F θ ′ ( S ˉ ; θ ) \nabla_{\theta_1}=\mathcal{F^{'}_\theta}(\bar{S};\theta) θ1=Fθ(Sˉ;θ)

​ Updated parameters θ ′ = θ − β ∇ θ 1 \theta^{'}=\theta-\beta\nabla_{\theta_1} θ=θβθ1

Meta-test:

​ Loss is G ( S ˇ ; θ ′ ) \mathcal{G}(\check{S};\theta^{'}) G(Sˇ;θ)

​ Gradients Update θ : \theta: θ:
∇ θ 2 = d G ( S ˇ ; θ ′ ) d θ = d G ( S ˇ ; θ − β ∇ θ 1 ) d θ ′ d θ ′ d θ = G θ ′ ′ ( S ˇ ; θ − β ∇ θ 1 ) d ( θ − β ∇ θ 1 ) d θ = G θ ′ ′ ( S ˇ ; θ − β ∇ θ 1 ) ( 1 − β d ∇ θ 1 d θ ) \nabla_{\theta_2}=\frac{d\mathcal{G}(\check{S};\theta^{'})}{d\theta}=\frac{d\mathcal{G}(\check{S};\theta-\beta\nabla_{\theta_1})}{d\theta^{'}}\frac{d\theta^{'}}{d\theta}=\mathcal{G^{'}_{\theta^{'}}}(\check{S};\theta-\beta\nabla_{\theta_1})\frac{d(\theta-\beta\nabla_{\theta_1})}{d\theta}=\mathcal{G^{'}_{\theta^{'}}}(\check{S};\theta-\beta\nabla_{\theta_1})(1-\beta\frac{d\nabla_{\theta_1}}{d\theta}) θ2=dθdG(Sˇ;θ)=dθdG(Sˇ;θβθ1)dθdθ=Gθ(Sˇ;θβθ1)dθd(θβθ1)=Gθ(Sˇ;θβθ1)(1βdθdθ1)

Meta-optimization: Update θ : c s d n 在线 m a r k d n o w 的 l a t e x 不支持 b e g i n { a l i g n } 标签,贴图如下 \theta:{\color{Red}csdn在线markdnow的latex不支持begin\{align\}标签,贴图如下} θ:csdn在线markdnowlatex不支持begin{align}标签,贴图如下
在这里插入图片描述

2.总结

MLDG是第一篇将meta learning引入domain generalization的论文。在这篇论文中, G ( ; ) = F ( ; ) = C r o s s E n t r o p y \mathcal{G}(;)=\mathcal{F}(;)=CrossEntropy G(;)=F(;)=CrossEntropy,二阶导几乎不起作用,训练模型的时候可以将代码中二阶导计算关掉(没用还很耗时)。

loss.backward(retain_graph=True, create_graph=True)
->改为
loss.backward(retain_graph=True, create_graph=False)

楼主跑过这篇文章的代码,性能与普通训练方式差不太多,即先在 S ˉ \bar{S} Sˉ训练更新,然后再在 S ˇ \check{S} Sˇ上训练更新。个人认为他的insight在于启发了后续的meta-dg方法,后续方法重新设计能够约束特征空间 G ( ; ) \mathcal{G}(;) G(;),后续方法是否有效等楼主验证后再更新。

  • 8
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 10
    评论
Welcome to the Practitioner Bundle of Deep Learning for Computer Vision with Python! This volume is meant to be the next logical step in your deep learning for computer vision education after completing the Starter Bundle. At this point, you should have a strong understanding of the fundamentals of parameterized learning, neural net works, and Convolutional Neural Networks (CNNs). You should also feel relatively comfortable using the Keras library and the Python programming language to train your own custom deep learning networks. The purpose of the Practitioner Bundle is to build on your knowledge gained from the Starter Bundle and introduce more advanced algorithms, concepts, and tricks of the trade — these tech- niques will be covered in three distinct parts of the book. The first part will focus on methods that are used to boost your classification accuracy in one way or another. One way to increase your classification accuracy is to apply transfer learning methods such as fine-tuning or treating your network as a feature extractor. We’ll also explore ensemble methods (i.e., training multiple networks and combining the results) and how these methods can give you a nice classification boost with little extra effort. Regularization methods such as data augmentation are used to generate additional training data – in nearly all situations, data augmentation improves your model’s ability to generalize. More advanced optimization algorithms such as Adam [1], RMSprop [2], and others can also be used on some datasets to help you obtain lower loss. After we review these techniques, we’ll look at the optimal pathway to apply these methods to ensure you obtain the maximum amount of benefit with the least amount of effort.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值