Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在 Loss 配置中增加 out_channel, 方便自定义数据训练 #9439

Open
wants to merge 3 commits into
base: release/2.6
Choose a base branch
from

Conversation

LittleGhosts
Copy link

在 公式识别CAN
发现自定义数据集训练的时候,当词表数量变化、修改对应 Architecture 下的 out_channel、word_num、counting_decoder_out_channel 会导致维度不匹配,查看源码发现 Loss 中的 out_channel 的写死的

在 CAN 算法的配置文件 Loss 下增加 out_channel 字段,同时修改 Loss 代码使用配置信息

@paddle-bot
Copy link

paddle-bot bot commented Mar 15, 2023

Thanks for your contribution!

@CLAassistant
Copy link

CLAassistant commented Mar 15, 2023

CLA assistant check
All committers have signed the CLA.

@@ -28,11 +28,11 @@ class CANLoss(nn.Layer):
counting_loss: counting loss of every symbol
'''

def __init__(self):
def __init__(self, out_channel):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里加个默认值out_channel=111

@LittleGhosts
Copy link
Author

@LDOUBLEV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants