Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/vision/attention_mil_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ class weighting should be considered.


def compute_class_weights(labels):
# Count number of postive and negative bags.
# Count number of positive and negative bags.
negative_count = len(np.where(labels == 0)[0])
positive_count = len(np.where(labels == 1)[0])
total_count = negative_count + positive_count
Expand Down
4 changes: 2 additions & 2 deletions examples/vision/ipynb/attention_mil_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@
"source": [
"\n",
"def compute_class_weights(labels):\n",
" # Count number of postive and negative bags.\n",
" # Count number of positive and negative bags.\n",
" negative_count = len(np.where(labels == 0)[0])\n",
" positive_count = len(np.where(labels == 1)[0])\n",
" total_count = negative_count + positive_count\n",
Expand Down Expand Up @@ -737,4 +737,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
2 changes: 1 addition & 1 deletion examples/vision/md/attention_mil_classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ Using class weights, the model will tend to give a higher weight to the rare cla
```python

def compute_class_weights(labels):
# Count number of postive and negative bags.
# Count number of positive and negative bags.
negative_count = len(np.where(labels == 0)[0])
positive_count = len(np.where(labels == 1)[0])
total_count = negative_count + positive_count
Expand Down
Loading