Code Monkey home page Code Monkey logo

Comments (8)

qian2729 avatar qian2729 commented on August 23, 2024 2

Writeed InverseBytes according to ReverseBytes
inline uint64_t InverseBytes(uint64_t x) { x = (x & 0x0F0F0F0F0F0F0F0FULL) << 4 | (x & 0xF0F0F0F0F0F0F0F0ULL) >> 4; x = (x & 0x00FF00FF00FF00FFULL) << 8 | (x & 0xFF00FF00FF00FF00ULL) >> 8; x = (x & 0x0000FFFF0000FFFFULL) << 16 | (x & 0xFFFF0000FFFF0000ULL) >> 16; x = x << 32 | x >> 32; return x; }
-- ignore this, we can just using ReverseBytes funtion again to inverse.

from difacto_dmlc.

CNevd avatar CNevd commented on August 23, 2024 1

@RockWater both can be ok

from difacto_dmlc.

CNevd avatar CNevd commented on August 23, 2024 1

@RockWater check issues8
you can use -max_key if you know your max key of feature id or write a inverse function for ReverseBytes in dump.cc as @Lisz1024 did :)

from difacto_dmlc.

RockWater avatar RockWater commented on August 23, 2024

@CNevd Txs. By the way, how to get the key id from the original feature id by some hashing trick ? Would like to get the pair of (feature id ,value ) rather than (key ,value) as exported by the model.

from difacto_dmlc.

CNevd avatar CNevd commented on August 23, 2024

@qian2729 great job! Could you send a pr for this?

from difacto_dmlc.

RockWater avatar RockWater commented on August 23, 2024

@CNevd @qian2729 many thanks.

from difacto_dmlc.

qian2729 avatar qian2729 commented on August 23, 2024

@CNevd @RockWater In fact, we don't need to write new inverse bytes function to remap new feature id to original feature id, just using ReverseBytes function(at src/base/localizer.h) at new feature id again, we can got the original feature id. [Tested]

from difacto_dmlc.

CNevd avatar CNevd commented on August 23, 2024

dump,cc has supported inverse bytes function, will close this issue

from difacto_dmlc.

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.