Code Monkey home page Code Monkey logo

incrementaled's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

incrementaled's Issues

Loss function in train.py

Thank you for the great job!
During studying the source code, I found something difficult for me to understand.

First

The loss function in 'train.py' is nn.CrossEntropyLoss().

logits, _ = self.model(train_X, train_mask)
p = logits[:, :, :self.seen_cls+1]
loss = criterion(p.view(-1, self.seen_cls+1), train_Y.view(-1))

The variable 'p' is the first self.seen_cls+1 colums of each matrix in logits tensor, but we usually utilize the index of max value in logits as the prediction result. Could you please tell me why do you choose the self.seen_cls+1 rows as input? And the shape of input is [batch_size * max_length, self.seen_cls+1], which is different with the shape of target 'train_Y.view(-1)'.

Second

outputs = self.bert(data_x, attention_mask = mask_x)
bert_enc = outputs[0]
logits = self.fc(bert_enc)
return logits, outputs[0]

The shape of the variable 'bert_enc' is [batch_size, max_length, hidden_size], and the shape of 'logits' is [batch_size, max_length, y_num]. Do you want to get the pooled result of bert encoder and the corresponding predictions?

Data format

Thanks for your great work! However, I wonder whether you could give some explanations about the data format in your codes? To exemplify this, what does the 7 mean in the following sample?
The same official said the IMF also insists that the good sections of the two banks be merged . 7 contact

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.