Code Monkey home page Code Monkey logo

Comments (3)

leiqing110 avatar leiqing110 commented on June 25, 2024

我发现这个问题了 你解决了吗

from deepctr.

shelson-woo avatar shelson-woo commented on June 25, 2024

我发现这个问题了 你解决了吗
我问chatgpt3.5 给的答案
在这个例子中,在创建 SequencePoolingLayer 层时将 supports_masking 参数设置为 True,因此该层支持输入数据的掩码功能。因此,在 call 方法中,如果 emb 层的 mask_zero 参数设置为 True,则 mask 参数将自动设置为输入数据的掩码张量。在这种情况下,mask 参数将是一个布尔型张量,其形状为 (batch_size, sequence_length)。True 值表示该时间步骤需要被忽略,False 值表示该时间步骤需要被保留。在 SequencePoolingLayer 中,将使用 mask 参数来忽略被掩码的时间步骤。
因此,在上述代码中,如果 emb 层的 mask_zero 参数设置为 True,则在调用 SequencePoolingLayer 的 call 方法时,mask 参数将自动设置为输入数据的掩码张量。否则,mask 参数将被设置为 None。如果 mask 参数为 None,则 SequencePoolingLayer 将不会使用掩码,从而保留所有时间步骤的信息。

from deepctr.

shelson-woo avatar shelson-woo commented on June 25, 2024

我发现这个问题了 你解决了吗

你通过使用debug 模式发现mask 并不是空的

from deepctr.

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.