Code Monkey home page Code Monkey logo

Comments (7)

tomsonsgs avatar tomsonsgs commented on September 12, 2024

i solve the problem by change the code if condition "i==0" by "j==0" in getTransition(y_train_batch) function,and loss come to 0 as expected,you all can check on that,and will this improve the final accuracy?someone can try that

from sequence-labeling.

Ethan1214 avatar Ethan1214 commented on September 12, 2024

Hi,@tomsonsgs
I have tried your method,and it works and make loss above 0, but the accuracy didn't improve obviously. I don't understand why did your make it break when j==0. In my opinion,we could ignore the transition-score that the last word of one sentence to the ending_tag("") if breaking when j==0.
For example, we have a true label_sequence when training: B M E O O B E ........ If breaking when j==0, we ignore the transition-score of "E to ". Although my loss came under 0, I think the primary method is right .

Can you tell me why did you make it break when j==0??

from sequence-labeling.

tomsonsgs avatar tomsonsgs commented on September 12, 2024

因为用i==0会让目标路径多加了一个最后一个字母到填充符的转移量,而计算整体路径得分只计算到最后一个字母自身得分没有加之后的转移得分

from sequence-labeling.

tomsonsgs avatar tomsonsgs commented on September 12, 2024

你可以看下原始代码关于所有路径得分的计算过程就知道了,他没有加最后的转移得分

from sequence-labeling.

Ethan1214 avatar Ethan1214 commented on September 12, 2024

@tomsonsgs
我看他在前向计算总路径得分的时候,对transition的运用并没有看出哪边对最后的转义得分做了省略,能否说明一下具体是哪几步操作呢?

万分感谢!

last_alphas = tf.gather(alphas, tf.range(0, self.batch_size) * (self.num_steps + 2) + length)
将length改成length+1是否可行, 这样i==0应该就不用改了??!!

from sequence-labeling.

fxh0919 avatar fxh0919 commented on September 12, 2024

想请问一下为什么代码中crf层的dummy_val设置成-1000?是有什么讲究么?

from sequence-labeling.

tomsonsgs avatar tomsonsgs commented on September 12, 2024

@fxh0919 一个极小值,表示某节点取到该类别得分极小,可以-2000等等,因为开始的话必然在起始状态,其他类别的可能性为0,但在log后一般取极小表示概率接近于0

from sequence-labeling.

Related Issues (20)

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.