public interface FunctionLinear<T extends Tensor> extends Function<T>
y = W*x + bwhere y is the output, W are the weights, x is the input, and b is the bias.
| Modifier and Type | Method and Description |
|---|---|
void |
forward(T input,
T output)
Input tensor shape =(N, d[i], ...
|
int |
getNumberOfOutputs()
Returns the number of output elements.
|
void |
setParameters(java.util.List<T> parameters)
See
forward(T, T) for a description of parameters. |
getOutputShape, getParameters, getParameterShapes, getTensorType, initializevoid forward(T input, T output)
Input tensor shape =(N, d[i], ... , d[K])
where N is the number of stacked inputs, d[i] is the number of inputs along dimension i, and K is
the dimension of the input space.
Tensor Parameters:
Weight matrix shape=(M,D)
bias shape=(M)
where D is the total number of inputs (Product d[i]) and M is the number of outputs.
NOTE: The tensor parameters' shape has been selected to minimize cache misses during matrix multiplication.
void setParameters(java.util.List<T> parameters)
forward(T, T) for a description of parameters.setParameters in interface Function<T extends Tensor>parameters - Weight and bias tensors with shapes (M, D), and (M,), respectively.int getNumberOfOutputs()