FCLayer#

class usencrypt.ai.nn.layers.FCLayer(input_size=None, output_size=None, weight_regularizer=None, bias_regularizer=None, _config=None)#

Fully-connected layer for neural networks, defined by the linear operation \(y = W^TX + b\), where \(W\) is the weights matrix, \(X\) is the features matrix, and \(b\) is the bias vector.

A fully-connected layer is instantiated with appropriate input and output sizes to ensure a correct linear transformation.

Parameters
Variables
  • input_size (int) – The size of the layer input.

  • output_size (int) – The number of units in the fully-connected layer.

  • weight_regularizer (usencrypt.ai.regularizers.Regularizer) – Regularizer applied to the weights matrix.

  • bias_regularizer (usencrypt.ai.regularizers.Regularizer) – Regularizer applied to the bias vector.

  • params (dict) – Dictionary containing all trainable parameters.

  • params_prime (dict) – Dictionary containing all parameter gradients.

  • name (str) – The layer’s string identifier.

Inheritance

usencrypt.ai.nn.layers.Layer

Examples

Like all layers, the fully-connected layer can be added to the top of a neural network architecture stack as follows:

>>> import usencrypt as ue
>>> net = ue.ai.nn.NeuralNetwork()
>>> net.add(ue.ai.nn.layers.FCLayer(input_size=4, output_size=3))