Dense

class tf_encrypted.layers.dense.Dense(input_shape, out_features, transpose_input=False, transpose_weight=False)[source]

Standard dense linear layer including bias.

Parameters:
  • in_features (int) – number of input features
  • out_features (int) – number of output neurons for the layer
backward(d_y, learning_rate)[source]

Backward pass for training.

forward(x)[source]

Forward pass for inference

get_output_shape()[source]

Returns the layer’s output shape

initialize(initial_weights: Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, tf_encrypted.protocol.pond.pond.PondPublicTensor, tf_encrypted.protocol.pond.pond.PondPrivateTensor, None] = None, initial_bias: Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, tf_encrypted.protocol.pond.pond.PondPublicTensor, tf_encrypted.protocol.pond.pond.PondPrivateTensor, None] = None) → None[source]

Initialize any necessary tensors.