ttpro1995 / TreeLSTMSentiment

Pytorch implementation of Sentiment Classification in Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks
MIT License
113 stars 40 forks source link

What is getParameters() used for? #9

Open ZhaofengWu opened 5 years ago

ZhaofengWu commented 5 years ago

Looks like nowhere is that called.

ttpro1995 commented 5 years ago

getParameters() is use to get weight matrix.

It is intend to override the function parameters() of any pytorch built-in model (see PyTorch: Extract learned weights correctly )

In this code, getParameters() is useful if you want to visualize, or debug

ttpro1995 commented 5 years ago

getParameters() call parameters() of each sub-module [self.ix, self.ih, self.fx, self.fh, self.ox, self.oh, self.ux, self.uh]