sparse-cafm / src /models /regression_head.py
leharris3's picture
Minimal HF Space deployment with gradio 5.x fix
0917e8d
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))