Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AdeelH authored Nov 5, 2020
1 parent f0d5355 commit dfc5f15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ It is essentially an enhancement to cross-entropy loss and is useful for classif
This repo supports importing modules through `torch.hub`. `FocalLoss` can be easily imported into your code via, for example:
```python3
focal_loss = torch.hub.load(
github='adeelh/pytorch-multi-class-focal-loss',
repo_or_dir='adeelh/pytorch-multi-class-focal-loss',
model='FocalLoss',
alpha=torch.tensor([.75, .25]),
gamma=2,
Expand All @@ -35,7 +35,7 @@ loss = focal_loss(x, y)
Or:
```python3
focal_loss = torch.hub.load(
github='adeelh/pytorch-multi-class-focal-loss',
repo_or_dir='adeelh/pytorch-multi-class-focal-loss',
model='focal_loss',
alpha=[.75, .25],
gamma=2,
Expand All @@ -46,4 +46,4 @@ focal_loss = torch.hub.load(
)
x, y = torch.randn(10, 2), (torch.rand(10) > .5).long()
loss = focal_loss(x, y)
```
```

0 comments on commit dfc5f15

Please sign in to comment.