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

Weighting factor for positive examples (conf['data']['positive_example_penalty']) only works for 'maxhinge' target #53

Open
1 task
felker opened this issue Dec 19, 2019 · 0 comments

Comments

@felker
Copy link
Member

felker commented Dec 19, 2019

The only time in which positive_example_penalty appears in the codebase is in:

# ensure shallow model has +1 -1 target.
if params['model']['shallow'] or params['target'] == 'hinge':
params['data']['target'] = HingeTarget
elif params['target'] == 'maxhinge':
MaxHingeTarget.fac = params['data']['positive_example_penalty']
params['data']['target'] = MaxHingeTarget
elif params['target'] == 'binary':
params['data']['target'] = BinaryTarget
elif params['target'] == 'ttd':
params['data']['target'] = TTDTarget
elif params['target'] == 'ttdinv':
params['data']['target'] = TTDInvTarget
elif params['target'] == 'ttdlinear':
params['data']['target'] = TTDLinearTarget
else:
g.print_unique('Unkown type of target. Exiting')
exit(1)

which is loaded only for an unused method in the MaxHingeTarget class, noted here:
def loss_np(y_true, y_pred):

Need to extend it to the other target functions, remove it as a parameter, or document this more thoroughly.

Not as important for DIII-D datasets as it is for our JET datasets (for which the non-/disruptive classes are more imbalanced).

  • Also, conf['training']['ranking_difficulty_fac']: 1.0 # how much to upweight incorrectly classified shots during training appears to perform a very related role, but instead within loader.py, mpi_runner.py, and performance.py.
@felker felker mentioned this issue Jan 6, 2020
4 tasks
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

No branches or pull requests

1 participant