deel-ai / oodeel

Simple, compact, and hackable post-hoc deep OOD detection for already trained tensorflow or pytorch image classifiers.
https://deel-ai.github.io/oodeel/
MIT License
52 stars 2 forks source link

output_layer_id should be required in the fit instead of instanciation of ood detector #68

Closed y-prudent closed 1 year ago

y-prudent commented 1 year ago

Before:

dknn = DKNN(output_layer_id=[-2])
dknn.fit(model, ds_fit)

After:

dknn = DKNN()
dknn.fit(model, ds_fit, output_layer_id=[-2])

[Update] Also, for improved clarity output_layers_id should be renamed feature_layers_id. The feature extractor would then return separately in a tuple: (1) the features (identified by feature_layers_id) and (2) the logits (output of last layer).

After v2:

dknn = DKNN()
dknn.fit(model, ds_fit, feature_layers_id=[-2])