Diagonal Examples

These examples use the diagonal primitives (Diagonal Primitives (FHEON-D)): the channels are mixed with diagonals instead of being folded one by one, so a convolution costs 8 hoisted rotations, one rotation per diagonal and a single multiplicative level. They are single-input models, run sequentially, and are built with -DMODE=DIAGONAL_SINGLE_INPUT (HEDiagonalSingleModels/).

Model

Dataset

Highlights

MLPDiagonal

MNIST

Leveled context, no bootstrapping.

LeNet5Diagonal

MNIST

Strided layout kept through the network, multiplexed conv2; 2.17 s per image. Leveled 2^15 chain at 128 bits (9.8 s per image).

LeNet5KeyOptimizedDiagonal

MNIST

The circuit of LeNet5Diagonal with a small memory footprint: no keys with the context, one key file per phase (convolutions, fully connected layers, and the bootstrapping with the performance parameters) loaded one at a time, weights encoded layer by layer. 18 s per image and 9.0 GB at 128 bits.

ResNet20Diagonal, ResNet20OptimizedDiagonal

CIFAR-10

Stride-2 blocks on shared taps; key file per stage or all keys in memory; 84 s per image.

ResNet34Diagonal

CIFAR-100

Four stages, key file per stage.

VGG11Diagonal, VGG16Diagonal

CIFAR-10

Normalized activations within [0, 1].