Comments (7)
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.
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.
因为用i==0会让目标路径多加了一个最后一个字母到填充符的转移量,而计算整体路径得分只计算到最后一个字母自身得分没有加之后的转移得分
from sequence-labeling.
你可以看下原始代码关于所有路径得分的计算过程就知道了,他没有加最后的转移得分
from sequence-labeling.
@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.
想请问一下为什么代码中crf层的dummy_val设置成-1000?是有什么讲究么?
from sequence-labeling.
@fxh0919 一个极小值,表示某节点取到该类别得分极小,可以-2000等等,因为开始的话必然在起始状态,其他类别的可能性为0,但在log后一般取极小表示概率接近于0
from sequence-labeling.
Related Issues (20)
- 请问下,HMM的predict这块的path和W指的什么? HOT 2
- 您好,请问几个代码调试过程中遇到的问题
- 在初始化的时候选择了is_crf=False,结果结果就是没有初始化loss,出错了 HOT 1
- confused about the task HOT 2
- 能帮忙提供下您实现的crf部分以及viterbi部分的一个理论上的教程吗? HOT 1
- 计算point score问题 HOT 1
- 请教您tf版本更新后的代码的变化 HOT 6
- 关于label数多于四个的问题 HOT 2
- 关于数据预处理的问题 HOT 3
- About datasets HOT 1
- 代码中带的那个NBA例子,训练后没找到存储的模型
- 关于y_train_weight_batch
- ImportError: No module named models.rnn HOT 1
- tf implemented CRF compared with API crf HOT 1
- why my loss decrease under 0 HOT 2
- word-embedding file
- 关于停用词被去掉的问题。
- transitions reshape的问题 HOT 1
- Why my loss is every small and under 0?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sequence-labeling.