Skip to content

Commit

Permalink
Fixing the typo in attention_mil_classification.ipynb (#2021)
Browse files Browse the repository at this point in the history
* Update attention_mil_classification.ipynb

* Update
  • Loading branch information
tilakrayal authored Jan 13, 2025
1 parent d780ebb commit 04d7cb3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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

0 comments on commit 04d7cb3

Please sign in to comment.