Using Torch
from torch import nn
import torch
N_FEAT = 2
class SimpleNet(nn.Module):
"""Simple MLP with torch"""
def __init__(self, n_hidden=30):
super().__init__()
self.fc1 = nn.Linear(in_features=N_FEAT, out_features=n_hidden)
self.fc2 = nn.Linear(in_features=n_hidden, out_features=n_hidden)
self.fc3 = nn.Linear(in_features=n_hidden, out_features=2)
def forward(self, x):
"""Forward pass."""
x = torch.relu(self.fc1(x))
x = torch.relu(self.fc2(x))
x = self.fc3(x)
return xQuantization aware training
Supported Operators and Activations
Operators
Univariate operators
Shape modifying operators
Operators that take an encrypted input and unencrypted constants
Operators that can take both encrypted+unencrypted and encrypted+encrypted inputs
Activations
Last updated
Was this helpful?