question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Class Distance Loss not working

See original GitHub issue

Using class_distance and class_distance_temperature for Category Output Features always leads to the error “No class_distance metadata available for …”. While checking the code I noticed that the CategoryBaseFeature class tries to access the class distances via the key distances from the features metadata. But they are never stored under that key. I think the whole implementation to calculate and store class distances is missing from the toolkit.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
w4nderlustcommented, Mar 11, 2019

@mullerpeter thanks for reporting this. After a quick look, it’s likely that it’s just a mismatch of names, will set it as a bug and resolve it quickly. Anyway, there is no calculation for class distances, the user is expected to provide the distances between classes in the model definition, and that is used by Ludwig in the calculation of the loss https://github.com/uber/ludwig/blob/master/ludwig/features/category_feature.py#L293 . Anyway, will use the occasion of fixing this bug to probably enhance this part, maybe renaming distances to similarities for instance, which makes a bit more sense, and adding some additional documentation about it. Will post the progress in this thread.

0reactions
mullerpetercommented, Mar 23, 2019

LGTM, thanks for your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

What should I do when my neural network doesn't learn?
Accuracy (0-1 loss) is a crappy metric if you have strong class imbalance. Try something more meaningful such as cross-entropy loss: you don't...
Read more >
Neural Networks Intuitions: 9. Distance Metric Learning
This paper solves the problem mentioned at the start of the article — “Classifiers do not minimize intra-class distance but only maxmize ...
Read more >
Transferring Knowledge to Smaller Network with Class ...
We propose class-distance loss that helps teacher networks to form densely clustered vector space to make it easy for the student network to...
Read more >
How to Choose Loss Functions When Training Deep Learning ...
Multi-Class Classification Loss Functions ... We will use this function to define a problem that has 20 input features; 10 of the features ......
Read more >
Squared Earth Mover's Distance Loss for Training Deep ...
stand-alone loss function for multi-class single-label classification problems using CNNs. The EMD is also known as the Wasserstein distance [1, 3], ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found