Comments (8)
Hello!
Is there a consensus on this? Unless I am missing something, I also think you might need create_graph = True
in order to propagate your gradients correctly through the inner gradient.
from maml-pytorch.
I also think it needs create_graph = True.
grad = torch.autograd.grad(loss, self.net.parameters())
My understanding is that the line above will give you grad.requires_grad = False
. Thus, there is no higher order gradients available. It's a first order MAML.
grad = torch.autograd.grad(loss, self.net.parameters(), create_graph = True)
The line above will give you grad.requires_grad = True
.
from maml-pytorch.
Generally speaking, you should set create_graph for 2nd order gradient.
However, the implementaton in this repo. is the 2nd order version.
from maml-pytorch.
I use pytorch1.0.The default setting create_graph is False.
And I checked the grad on Meta.py line 86 and line116.
grad = torch.autograd.grad(loss, fast_weights)
The require_grads about grad is False.
I am not sure the implementaton in this repo. is the 2nd order version.
from maml-pytorch.
@lynlynlyn IT's 2nd order implementation.
I think you should digest the paper to understand how to derive 2nd order gradient.
It's not simply set create_graph=True
.
Sorry.
from maml-pytorch.
if the inner loop gradients's require_grads=False
,where is the 2nd order gradient?
from maml-pytorch.
@Deng-Y well, I have not worked on this project a long time. sorry for misleading information. Have you tried setting create_grape=True
?
from maml-pytorch.
@dragen1860 I only try it on the other project. Not sure if it will improve the performance on this one.
from maml-pytorch.
Related Issues (20)
- why use custom grad clip function?
- omniglot dataset download error HOT 1
- Does the hessian really gets computed? HOT 1
- Can you please add a 1-d CNN model to the learner.
- Incorrect losses_q HOT 3
- about dataset spiltting
- create_graph parameter is False hence first-order MAML? HOT 1
- Asking about inner and outer loop
- 您好,对于代码有两个问题,请教您一下,谢谢 HOT 3
- About training and testing HOT 6
- can you offer us your requirements of environment?
- Why is `for epoch in range(args.epoch // 10000):` HOT 2
- Why the code for Learner is so complicated? HOT 1
- 请问模型权值文件在哪里进行保存?代码在哪里? HOT 1
- debug
- Using the Learner object for my project, Loss not behaving at its best
- About accuracy HOT 6
- What is the backup file for and what is the reference navie5 in navie5?
- 准确率不变 HOT 4
- 训练自己的数据集
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maml-pytorch.