Spaces:
Configuration error
Configuration error
Download utils/ImageOnly.py from vieunite/DemoEmotions: direct link, hf CLI and curl.
- Browser
- Download file 859 Bytes
-
https://huggingface.co/spaces/vieunite/DemoEmotions/resolve/main/utils/ImageOnly.py
- Command line
-
hf download hf://spaces/vieunite/DemoEmotions/utils/ImageOnly.py
-
curl -L -o ImageOnly.py https://huggingface.co/spaces/vieunite/DemoEmotions/resolve/main/utils/ImageOnly.py
859 Bytes
| import torch.nn as nn | |
| class Decoder4(nn.Module): | |
| def __init__(self, input_dim, output_dim): | |
| super(Decoder4, self).__init__() | |
| self.fc1 = nn.Linear(input_dim, 256) | |
| self.batch_norm1 = nn.BatchNorm1d(256) | |
| self.relu1 = nn.ReLU() | |
| self.dropout1 = nn.Dropout(0.5) | |
| self.fc2 = nn.Linear(256, 128) | |
| self.batch_norm2 = nn.BatchNorm1d(128) | |
| self.relu2 = nn.ReLU() | |
| self.dropout2 = nn.Dropout(0.5) | |
| self.fc3 = nn.Linear(128, output_dim) | |
| self.sigmoid = nn.Sigmoid() | |
| def forward(self, x): | |
| x = self.fc1(x) | |
| x = self.batch_norm1(x) | |
| x = self.relu1(x) | |
| x = self.dropout1(x) | |
| x = self.fc2(x) | |
| x = self.batch_norm2(x) | |
| x = self.relu2(x) | |
| x = self.dropout2(x) | |
| x = self.fc3(x) | |
| x = self.sigmoid(x) | |
| return x | |