GithubHelp home page GithubHelp logo

Comments (2)

archersama avatar archersama commented on July 22, 2024

For company privacy, we can't provide serving code. We don't use faiss to compute maxsim score, we have our own container to save embedding,and maxsim score is computed out of container. To compute maxsim score in a parallel way, just add FE-layer in user every layer and item tower last layer and compute maxsim score. In our code ,the multi head maxsim score is computed in a parallel way

self.Fe_linears = nn.ModuleList(
          [nn.Linear(hidden_units[i], self.field_dim*self.user_head) for i in range(len(hidden_units) - 1)])
def fe_score(user_rep, item_rep, user_fea_col, item_fea_col, user_embedding_dim, item_embedding_dim):
  score = []
  for i in range(len(user_embedding_dim)):
    user_temp = torch.reshape(user_rep[i], (-1, user_fea_col, user_embedding_dim[i]))
    item_temp = torch.reshape(item_rep[-1], (-1, item_fea_col, item_embedding_dim[i]))
    score.append((user_temp @ item_temp.permute(0, 2, 1)).max(2).values.sum(1))
  score = torch.stack(score).transpose(1, 0)
  return torch.sum(score, 1)

from inttower.

thinkwee avatar thinkwee commented on July 22, 2024

got it. thx for your reply~

from inttower.

Related Issues (8)

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.