use of com.simiacryptus.mindseye.layers.java.ReshapeLayer in project MindsEye by SimiaCryptus.
the class FullyConnectedLayer method explode.
/**
* Explode pipeline network.
*
* @return the pipeline network
*/
@Nonnull
public Layer explode() {
int inputVol = Tensor.length(inputDims);
int outVol = Tensor.length(outputDims);
@Nonnull PipelineNetwork network = new PipelineNetwork(1);
network.wrap(new ReshapeLayer(1, 1, inputVol));
@Nullable Tensor tensor = this.weights.reshapeCast(1, 1, inputVol * outVol);
@Nonnull ConvolutionLayer convolutionLayer = new ConvolutionLayer(1, 1, inputVol, outVol).set(tensor).setBatchBands(getBatchBands());
@Nonnull ExplodedConvolutionGrid grid = convolutionLayer.getExplodedNetwork();
convolutionLayer.freeRef();
tensor.freeRef();
grid.add(network.getHead());
grid.freeRef();
network.wrap(new ReshapeLayer(outputDims));
network.setName(getName());
return network;
}
Aggregations