GithubHelp home page GithubHelp logo

Comments (7)

zheng-yuwei avatar zheng-yuwei commented on May 29, 2024

作者你好 我在测试GHM 使用的时候 valid_mask 参数怎么设置啊

可以参考 valid_mask = 1.0 - tf.cast(tf.less(y_truth, 0), dtype=tf.float32),这个参数是作为哪些样本是需要统计loss的标志位,所以你可以直接按上面等式这样设置

from multi-label-classification.

qiaoxiu avatar qiaoxiu commented on May 29, 2024

非常感谢你的回复,我这还有一个问题 不知道 是不是 我操作的问题
y_truth = keras.backend.flatten(y_truth) 针对y_truth进行平铺
然后进行 y_truth = keras.backend.one_hot(indices=y_truth, num_classes=2)
会导致 后面 y_pred和y_truth 的 shape 不匹配

from multi-label-classification.

zheng-yuwei avatar zheng-yuwei commented on May 29, 2024

非常感谢你的回复,我这还有一个问题 不知道 是不是 我操作的问题
y_truth = keras.backend.flatten(y_truth) 针对y_truth进行平铺
然后进行 y_truth = keras.backend.one_hot(indices=y_truth, num_classes=2)
会导致 后面 y_pred和y_truth 的 shape 不匹配

你这样我也不知道什么问题呀 -。- 要不你自己debug看看

from multi-label-classification.

qiaoxiu avatar qiaoxiu commented on May 29, 2024

好了 非常感谢

from multi-label-classification.

zheng-yuwei avatar zheng-yuwei commented on May 29, 2024

好了 非常感谢

good~

from multi-label-classification.

cfjcyc0301 avatar cfjcyc0301 commented on May 29, 2024

好了 非常感谢

good~

作者你好,运行ghm时报错

valid_bin = tf.reduce_sum(tf.cast(valid_bin, dtype=tf.float32), axis=(1, 2))
这行代码的axis=(1, 2)与valid_bin的shape(30, None)不匹配

报错:ValueError: Invalid reduction dimension 2 for input with 2 dimensions. for '{{node ghm_class_loss/Sum}} = Sum[T=DT_FLOAT, Tidx=DT_INT32, keep_dims=false](ghm_class_loss/Cast_2, ghm_class_loss/Sum/reduction_indices)' with input shapes: [30,?], [2] and with computed input tensors: input[1] = <1 2>.

我最近一直在改ghm代码,但都是报错,请问要怎么解决维度问题,希望作者能回复我,非常感谢。

from multi-label-classification.

zheng-yuwei avatar zheng-yuwei commented on May 29, 2024

没遇到过,我也不太清楚。可能需要你自己debug一下了... 这个库是2年前的了,我已经转投pytorch了 : )

from multi-label-classification.

Related Issues (5)

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.