I am trying to replicate the algo outlined in the MAML paper:

  
      arxiv.org
  
  
    
1703.03400.pdf

3.88 MB

  
  
    
    
  
  


Pseudo code:

maml_algo.png730×501 76.6 KB

The idea is to compute a second order gradient. While computing the first order gradient is straightforward, computing the second order gradient as mentioned in this paper is a little bit tricky. The pseudo code should give a good understanding.