CLIP-based-NSFW-Detector / h14_nsfw_model.py
abhishek-kumar's picture
Add github files
a04f9f9
raw
history blame
772 Bytes
import torch.nn as nn
class H14_NSFW_Detector(nn.Module):
def __init__(self, input_size=1024):
super().__init__()
self.input_size = input_size
self.layers = nn.Sequential(
nn.Linear(self.input_size, 1024),
nn.ReLU(),
nn.Dropout(0.2),
nn.Linear(1024, 2048),
nn.ReLU(),
nn.Dropout(0.2),
nn.Linear(2048, 1024),
nn.ReLU(),
nn.Dropout(0.2),
nn.Linear(1024, 256),
nn.ReLU(),
nn.Dropout(0.2),
nn.Linear(256, 128),
nn.ReLU(),
nn.Dropout(0.2),
nn.Linear(128, 16),
nn.Linear(16, 1)
)
def forward(self, x):
return self.layers(x)