Skip to content

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

@felker

Description

@felker

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions