Skip to content
Open
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 lab1/text_recognizer/lit_models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def update(self, preds: torch.Tensor, target: torch.Tensor) -> None:
Normalized preds are not necessary for accuracy computation as we just care about argmax().
"""
if preds.min() < 0 or preds.max() > 1:
preds = torch.nn.functional.softmax(preds, dim=-1)
preds = torch.nn.functional.softmax(preds, dim=1)
super().update(preds=preds, target=target)


Expand Down
2 changes: 1 addition & 1 deletion lab2/text_recognizer/lit_models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def update(self, preds: torch.Tensor, target: torch.Tensor) -> None:
Normalized preds are not necessary for accuracy computation as we just care about argmax().
"""
if preds.min() < 0 or preds.max() > 1:
preds = torch.nn.functional.softmax(preds, dim=-1)
preds = torch.nn.functional.softmax(preds, dim=1)
super().update(preds=preds, target=target)


Expand Down
2 changes: 1 addition & 1 deletion lab3/text_recognizer/lit_models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def update(self, preds: torch.Tensor, target: torch.Tensor) -> None:
Normalized preds are not necessary for accuracy computation as we just care about argmax().
"""
if preds.min() < 0 or preds.max() > 1:
preds = torch.nn.functional.softmax(preds, dim=-1)
preds = torch.nn.functional.softmax(preds, dim=1)
super().update(preds=preds, target=target)


Expand Down
2 changes: 1 addition & 1 deletion lab4/text_recognizer/lit_models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def update(self, preds: torch.Tensor, target: torch.Tensor) -> None:
Normalized preds are not necessary for accuracy computation as we just care about argmax().
"""
if preds.min() < 0 or preds.max() > 1:
preds = torch.nn.functional.softmax(preds, dim=-1)
preds = torch.nn.functional.softmax(preds, dim=1)
super().update(preds=preds, target=target)


Expand Down
2 changes: 1 addition & 1 deletion lab5/text_recognizer/lit_models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def update(self, preds: torch.Tensor, target: torch.Tensor) -> None:
Normalized preds are not necessary for accuracy computation as we just care about argmax().
"""
if preds.min() < 0 or preds.max() > 1:
preds = torch.nn.functional.softmax(preds, dim=-1)
preds = torch.nn.functional.softmax(preds, dim=1)
super().update(preds=preds, target=target)


Expand Down
2 changes: 1 addition & 1 deletion lab7/text_recognizer/lit_models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def update(self, preds: torch.Tensor, target: torch.Tensor) -> None:
Normalized preds are not necessary for accuracy computation as we just care about argmax().
"""
if preds.min() < 0 or preds.max() > 1:
preds = torch.nn.functional.softmax(preds, dim=-1)
preds = torch.nn.functional.softmax(preds, dim=1)
super().update(preds=preds, target=target)


Expand Down
2 changes: 1 addition & 1 deletion lab8/text_recognizer/lit_models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def update(self, preds: torch.Tensor, target: torch.Tensor) -> None:
Normalized preds are not necessary for accuracy computation as we just care about argmax().
"""
if preds.min() < 0 or preds.max() > 1:
preds = torch.nn.functional.softmax(preds, dim=-1)
preds = torch.nn.functional.softmax(preds, dim=1)
super().update(preds=preds, target=target)


Expand Down
2 changes: 1 addition & 1 deletion lab9/text_recognizer/lit_models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def update(self, preds: torch.Tensor, target: torch.Tensor) -> None:
Normalized preds are not necessary for accuracy computation as we just care about argmax().
"""
if preds.min() < 0 or preds.max() > 1:
preds = torch.nn.functional.softmax(preds, dim=-1)
preds = torch.nn.functional.softmax(preds, dim=1)
super().update(preds=preds, target=target)


Expand Down