Skip to content

Fix MAML for num_grad_update > 1#1283

Merged
naeioi merged 1 commit intomasterfrom
maml_ngrad
Apr 7, 2020
Merged

Fix MAML for num_grad_update > 1#1283
naeioi merged 1 commit intomasterfrom
maml_ngrad

Conversation

@naeioi
Copy link
Copy Markdown
Member

@naeioi naeioi commented Apr 6, 2020

This fixes #1269 , that MAML breaks when num_grad_update is larger than 1.

This is because gradient information is cleared out after the first gradient update, but it is needed for later gradient updates.

@naeioi naeioi requested a review from a team as a code owner April 6, 2020 22:28
Copy link
Copy Markdown
Contributor

@krzentner krzentner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! That makes sense, and is surprisingly simple. LGTM.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 6, 2020

Codecov Report

Merging #1283 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1283   +/-   ##
=======================================
  Coverage   89.10%   89.10%           
=======================================
  Files         194      194           
  Lines        9652     9655    +3     
  Branches     1226     1226           
=======================================
+ Hits         8600     8603    +3     
  Misses        816      816           
  Partials      236      236           
Impacted Files Coverage Δ
src/garage/torch/algos/maml.py 96.81% <100.00%> (+0.06%) ⬆️
src/garage/envs/grid_world_env.py 84.12% <0.00%> (-4.77%) ⬇️
src/garage/plotter/plotter.py 64.77% <0.00%> (+3.40%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aabfe20...8b2a1fb. Read the comment docs.

@naeioi
Copy link
Copy Markdown
Member Author

naeioi commented Apr 7, 2020

@Mergifyio rebase

Grad of tensor is needed for the next grad update. Keep grad except for
the last grad update.
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 7, 2020

Command rebase: success

Branch has been successfully rebased

@naeioi naeioi merged commit 171dde0 into master Apr 7, 2020
@naeioi naeioi deleted the maml_ngrad branch April 7, 2020 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MAML does not work when num_grad_updates > 1

4 participants