Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit a34ccc5

Browse files
litesaber15facebook-github-bot
authored andcommitted
Changes to ClassyVision to support regression task with List[float] labels (#106)
Summary: X-link: fairinternal/ClassyVision#106 Pull Request resolved: #795 The v0 model of XRayRelevance project is a distillation model where we use the MViTv2 AV trunk to regress on IG's TTSN engagement embeddings. More details on project: https://docs.google.com/document/d/1SJaPU2xckTwUSE3Z8tONBj3jz1BvPQbifEHorH8Oe08/edit This diff makes following changes to classyvision: - support List[float] label type for regression - support "none" activation_func in ClassyHead Reviewed By: mannatsingh Differential Revision: D38049210 fbshipit-source-id: 07bd6352d303e4a23502d92ae2f8bfd4c659d894
1 parent 322518b commit a34ccc5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

classy_vision/heads/fully_convolutional_linear_head.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ def __init__(self, dim_in, num_classes, act_func="softmax"):
2424
self.act = nn.Softmax(dim=4)
2525
elif act_func == "sigmoid":
2626
self.act = nn.Sigmoid()
27+
elif act_func == "identity":
28+
# for some tasks eg. regression, we don't want an activation function
29+
self.act = nn.Identity()
2730
else:
2831
raise NotImplementedError(
2932
"{} is not supported as an activation" "function.".format(act_func)

0 commit comments

Comments
 (0)