Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] Fix JS metric #99

Merged
merged 1 commit into from
Feb 12, 2021
Merged

[bugfix] Fix JS metric #99

merged 1 commit into from
Feb 12, 2021

Conversation

milah
Copy link
Contributor

@milah milah commented Feb 10, 2021

Issue #, if available: P44014016

Description of changes:
According to our developer guide for JS metric (which is aligned with the formula on wiki Jensen-Shannon divergence)

The formula for the Jensen-Shannon divergence is as follows:

JS = ½*[KL(Pa || P) + KL(Pd || P)]

Where P = ½( Pa + Pd ), the average label distribution across facets a and d.

Instead we currently use the label distribution in the dataset. This PR fixes this bug reported by Xiaoguang.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tested: used in the Container as package.

@milah milah requested a review from larroy as a code owner February 10, 2021 19:14
src/smclarify/bias/metrics/posttraining.py Outdated Show resolved Hide resolved
src/smclarify/bias/metrics/pretraining.py Outdated Show resolved Hide resolved
tests/unit/bias/metrics/test_metrics.py Outdated Show resolved Hide resolved
@milah milah force-pushed the fix-js branch 2 times, most recently from fe6d4ec to e106f24 Compare February 12, 2021 01:02
Copy link
Member

@pinaraws pinaraws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit pick, rest looks good to me, thanks!

src/smclarify/bias/metrics/posttraining.py Outdated Show resolved Hide resolved
@milah milah merged commit d9446e2 into aws:master Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants