File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ It is essentially an enhancement to cross-entropy loss and is useful for classif
2222This repo supports importing modules through `torch.hub` . `FocalLoss` can be easily imported into your code via, for example:
2323```python3
2424focal_loss = torch.hub.load(
25- github = ' adeelh/pytorch-multi-class-focal-loss' ,
25+ repo_or_dir = ' adeelh/pytorch-multi-class-focal-loss' ,
2626 model = ' FocalLoss' ,
2727 alpha = torch.tensor([.75 , .25 ]),
2828 gamma = 2 ,
@@ -35,7 +35,7 @@ loss = focal_loss(x, y)
3535Or:
3636```python3
3737focal_loss = torch.hub.load(
38- github = ' adeelh/pytorch-multi-class-focal-loss' ,
38+ repo_or_dir = ' adeelh/pytorch-multi-class-focal-loss' ,
3939 model = ' focal_loss' ,
4040 alpha = [.75 , .25 ],
4141 gamma = 2 ,
@@ -46,4 +46,4 @@ focal_loss = torch.hub.load(
4646)
4747x, y = torch.randn(10 , 2 ), (torch.rand(10 ) > .5 ).long()
4848loss = focal_loss(x, y)
49- ```
49+ ```
You can’t perform that action at this time.
0 commit comments