Comments (7)
作者你好 我在测试GHM 使用的时候 valid_mask 参数怎么设置啊
可以参考 valid_mask = 1.0 - tf.cast(tf.less(y_truth, 0), dtype=tf.float32),这个参数是作为哪些样本是需要统计loss的标志位,所以你可以直接按上面等式这样设置
from multi-label-classification.
非常感谢你的回复,我这还有一个问题 不知道 是不是 我操作的问题
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.
非常感谢你的回复,我这还有一个问题 不知道 是不是 我操作的问题
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.
好了 非常感谢
from multi-label-classification.
好了 非常感谢
good~
from multi-label-classification.
好了 非常感谢
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.
没遇到过,我也不太清楚。可能需要你自己debug一下了... 这个库是2年前的了,我已经转投pytorch了 : )
from multi-label-classification.
Related Issues (5)
- 求原论文 HOT 3
- 直接运行报错 HOT 4
- BACKBONE_MIXNET_18 HOT 3
- 我是torch选手,咨询一下GHMLoss的valid mask是怎么产生的 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multi-label-classification.