Spaces:
Sleeping
Sleeping
File size: 362 Bytes
0917e8d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import torch
import torch.nn as nn
class RegressionHead(nn.Module):
"""
Custom classification head used for predicting the final output value z.
"""
def __init__(self, in_channels):
super(RegressionHead, self).__init__()
self.fc1 = nn.Linear(in_channels, 1)
def forward(self, x):
return torch.sigmoid(self.fc1(x))
|