CS224N | Winter2019 | Assignment 3 Solution

Follow Jun 18, 2020 · 2 mins read
CS224N | Winter2019 | Assignment 3 Solution
Share this

CS224n, 2019W - Assignment3 Solution

HW3: Dependency parsing and neural network foundations
you can find material: code handout

Table of contents

1. Machine Learning & Neural Networks (8 points)

(a) Adam Optimizer


Momentum is working as acceleration reflecting the previous gradients tendency.
Hight variance is well known to raising overfitting problem.


Parameters that previous gradients are small and not volatile get larger updates.
This helps model to handle with sparse gradients(merits of AdaGrad) and also non-stationary objectives(merits of RMSProp)

(b) Dropout


\[\gamma = \frac{1}{1-P_{drop}}\]


Drop out is one of the regularizations, which restrict an overfitting. Randomly setting units zero is for make units stronger on abrupt absence of other units.

And evaluation is made from train, to model being improved. But if we use drop out also at evaluation, it does re-trained with same circumstances, so that can’t do well in test.

2. Neural Transition-Based Dependency Parsing (42 points)


Stack Buffer New dependency Transition
[ROOT] [I, parsed, this, sentence, correctly]   Initial
[ROOT] [I, parsed, this, sentence, correctly]   SHIFT
[ROOT, I] [parsed, this, sentence, correctly]   SHIFT
[ROOT, I, parsed] [this, sentence, correctly] parsed$\rightarrow$ LEFT-ARC
[ROOT, parsed] [this, sentence, correctly]   SHIFT
[ROOT, parsed, this] [sentence, correctly]   SHIFT
[ROOT, parsed, this, sentence] [correctly] sentence$\rightarrow$this LEFT-ARC
[ROOT, parsed, sentence] [correctly] parsed$\rightarrow$sentence RIGHT-ARC
[ROOT, parsed] [correctly]   SHIFT
[ROOT, parsed, correctly] [] parsed$\rightarrow$correctly RIGHT-ARC
[ROOT, parsed] [] ROOT$\rightarrow$parsed RIGHT-ARC
[ROOT] []    


n steps for each of buffer and stack

Whole scripts are here.

(c), (d), (e)

Tips: problem 2-d needs shallow copy, not deep copy and TA advised not to use del function, here is good explaination remove vs del



  • Error type: Verb Phrase Attachment Error
  • Incorrect dependency: wedding → fearing
  • Correct dependency: heading → fearing


  • Error type: Coordination Attachment Error
  • Incorrect dependency: rescue → and
  • Correct dependency: rescue → rush


  • Error type: Prepositional Phrase Attachment Error
  • Incorrect dependency: named → Midland
  • Correct dependency: guy → Midland


  • Error type: Modifier Attachment Error
  • Incorrect dependency: element → most
  • Correct dependency: crucial → most