GithubHelp home page GithubHelp logo

Comments (4)

ZhongchuanSun avatar ZhongchuanSun commented on May 19, 2024 1

库中有cpp并行版本测试的代码, 在命令行中切换库的根目录, 然后使用'python setup.py build_ext --inplace'命令编译cpp代码, 编译成功之后会自动使用cpp版本的测试

from neurec.

somTian avatar somTian commented on May 19, 2024

来点赞了,根据您的建议,测试速度确实提高了很多

from neurec.

somTian avatar somTian commented on May 19, 2024

库中有cpp并行版本测试的代码, 在命令行中切换库的根目录, 然后使用'python setup.py build_ext --inplace'命令编译cpp代码, 编译成功之后会自动使用cpp版本的测试

您好,根据您的建议,我在使用框架里的算法的时候,速度快了很多,但是在我自己的模型上跑的时候,并没有提高速度,测试阶段CPU一直在100%,好像并没有并行,请问这是什么原因呢

from neurec.

ZhongchuanSun avatar ZhongchuanSun commented on May 19, 2024

自己的模型需要实现predict(user_ids, items=None)接口, 测试器通过调用这个接口来实现测试. user_ids是一批用户(一维数组或list), items是None或二维数组(或list). 当items为None时, 需要返回用户对所有物品的评分; 如果items不为None, 此时len(items)==len(user_ids), 只需返回用户对对应物品的评分即可.
cpp加速的地方是得到评分信息后, 计算评价指标时的部分; 如果模型在预测评分时比较慢,则需要优化这部分代码了.

from neurec.

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.