RepeatVector

  • namespace: Rindow\NeuralNetworks\Layer
  • classname: RepeatVector

Layer that concatenates a list of inputs.

Combines the listed NDArrays on the specified axis and outputs.

Concatenate implements the operation:

  • output := concat([input1, input2….], axis=-1)

Methods

constructor

$builer->RepeatVector(
    int $repeats,
    array $input_shape=null,
    string $name=null,
)

You can create a Concatenate layer instances with the Layer Builder.

Arguments

  • repeats: Number of repetitions.

Options

  • input_shape: Tell the first layer the shape of the input data. In input_shape, the batch dimension is not included.

Input shape

2D array of shape.

[batchsize, features]

Output shape

3D array of shape.

[batchsize, repeats, features]

$concat = $builder->layers()->RepeatVector($repeats=3);
....
$inputs = $mo->ones([4,2]);
....
$outputs = $concat->forward($inputs,true);
# $outputs->shape() : [4,3,2]

Examples

$model->add($nn->layers()->RepeatVector($repeats=8));