Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • Paddle
  • Issue
  • #14534

P
Paddle
  • 项目概览

PaddlePaddle / Paddle
大约 2 年 前同步成功

通知 2325
Star 20933
Fork 5424
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 1423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
P
Paddle
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 1,423
    • Issue 1,423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
    • 合并请求 543
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板
已关闭
开放中
Opened 11月 22, 2018 by saxon_zh@saxon_zhGuest

v2版本使用factorization_machine出错

Created by: zyz282994112

数据输入为sparse_binary_vector时,代码可以正常运行,将多个sparse_binary_vector concat后,运行时会出“F1122 11:02:32.585233 6142 BaseMatrix.cu:91] Check failed: !b.isSparse() Sparse Matrix/Vector is not supported.F1122 11:02:32.591529 6143 BaseMatrix.cu:91] Check failed: !b.isSparse() Sparse Matrix/Vector is not supported.F1122 11:02:32.596053 6144 BaseMatrix.cu:91] Check failed: !b.isSparse() Sparse Matrix/Vector is not supported.”错误。出错代码片段如下:

def fm_layer(self, input_data, factor_size, fm_param_attr):
    first_order = paddle.layer.fc(input=input_data,
                                  size=1,
                                  act=paddle.activation.Linear())
    second_order = paddle.layer.factorization_machine(
        input=input_data,
        factor_size=factor_size,
        act=paddle.activation.Linear(),
        param_attr=fm_param_attr)
    out = paddle.layer.addto(
        input=[first_order, second_order],
        act=paddle.activation.Linear(),
        bias_attr=False)
    return out

def network(self, is_predict=False):
    word_dict_size = self._word_dict_size
    vocab_dict_size = self._vocab_dict_size
    hidden_size = self._hidden_size
    ########################
    reset_parser()
    month = paddle.layer.data(name="month", type=paddle.data_type.sparse_binary_vector(12))
    year = paddle.layer.data(name="year", type=paddle.data_type.sparse_binary_vector(2))
    vocab = paddle.layer.data(name="vocab", type=paddle.data_type.sparse_binary_vector(vocab_dict_size))
    comb_layer = paddle.layer.concat(input=[vocab, month, year])
    vocab_layer = self.fm_layer(comb_layer, 16, fm_param_attr=paddle.attr.Param(name="VocabFactors"))

    feature_concat_layer = paddle.layer.concat(input=[lstm_max_query, lstm_max_query_time, time_layer, vocab_layer])
    feature_concat_layer = paddle.layer.batch_norm(input=feature_concat_layer, act=paddle.activation.Relu())  
    weight = paddle.layer.data(name="weight", type=paddle.data_type.dense_vector(1))
    label = paddle.layer.data(name="label", type=paddle.data_type.integer_value(2))
    cost = paddle.layer.classification_cost(input=output, label=label, weight=weight)
    return cost
指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/Paddle#14534
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7