CoolFace
Apppublic

Dieterrr/single_cell_test

sourceHugging Facemitupdated 3y agoView on Hugging Face
0likes
model_web_app.py22 linesDownload Raw Back to root
1from torch import nn2import torch.nn.functional as F3 4 5 6 7class FullyConnectedModelSubset(nn.Module):8    def __init__(self):9        super(FullyConnectedModelSubset, self).__init__()10        # Define the fully connected layers11        self.fc1 = nn.Linear(2000, 256)  # Input to first hidden layer12        self.fc2 = nn.Linear(256, 9)    # First hidden to second hidden layer13 14    def forward(self, x):15        # Forward pass through the network16        x = F.silu(self.fc1(x))  # Activation function after first layer17        x = self.fc2(x) # No activation, CrossEntropyLoss expects without 18        return x19 20 21 22