FullyconnectedOperator

public class FullyconnectedOperator: ComputableOperator

The regular fully connected operator. Operator do the 1D_dot(inputTensor.flatten, weights) + bias calculation on all input tensors.

Weight tensor layout

The weight is a 2D tensor with shape: [n, m] where :

  • n: the flattened dimension of inputTensors, i.e. same value as count of a input tensor.
  • m: the number of hidden nodes, same value as numUnits;

Thus, each column stores the weights of corresponding hidden unit.

Bias tensor layout

The bias is a 1D tensor with shape [m] where:

  • m: the number of hidden nodes, same value as numUnits;

Thus, each value in the tensor is the bias value of corresponding hidden unit.

Input tensors auto flatten

For input tensor with rank >=2, the operator will automatically flatten the tensor and then do calcualtion.

Multiple input tensors

If inputTensors has more than 1 tensor object, the operator applies calculation on each input tensor independently and stores the results in corresponding tensor of outputTensors.

Note

All input tensor should have same count.

Bias enable choice

Bias could be disabled by setting the biasEnabled to false.

Batch calculation

This operator itself does not explicitly support batch calculation. But user can use slice tensor to do the same thing. Details can be found in Slice tensor and Batch calculation with operators