Instructions to use DBD-research-group/AudioProtoPNet-10-BirdSet-XCL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DBD-research-group/AudioProtoPNet-10-BirdSet-XCL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("audio-classification", model="DBD-research-group/AudioProtoPNet-10-BirdSet-XCL", trust_remote_code=True)# Load model directly from transformers import AutoModelForSequenceClassification model = AutoModelForSequenceClassification.from_pretrained("DBD-research-group/AudioProtoPNet-10-BirdSet-XCL", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_protonet.py
Browse files- modeling_protonet.py +1 -1
modeling_protonet.py
CHANGED
|
@@ -854,7 +854,7 @@ class AudioProtoNetPreTrainedModel(PreTrainedModel):
|
|
| 854 |
nn.init.trunc_normal_(module.weight, std=0.02)
|
| 855 |
if module.bias is not None:
|
| 856 |
nn.init.zeros_(module.bias)
|
| 857 |
-
if
|
| 858 |
# Initialize all weights to the correct_class_connection value
|
| 859 |
self.last_layer.weight.data.fill_(self.correct_class_connection)
|
| 860 |
|
|
|
|
| 854 |
nn.init.trunc_normal_(module.weight, std=0.02)
|
| 855 |
if module.bias is not None:
|
| 856 |
nn.init.zeros_(module.bias)
|
| 857 |
+
if isinstance(module, LinearLayerWithoutNegativeConnections) and self.incorrect_class_connection is None: # TODO missing initilization
|
| 858 |
# Initialize all weights to the correct_class_connection value
|
| 859 |
self.last_layer.weight.data.fill_(self.correct_class_connection)
|
| 860 |
|