Package deepboof.misc

Class TensorFactory<T extends Tensor>

java.lang.Object
deepboof.misc.TensorFactory<T>

public class TensorFactory<T extends Tensor> extends Object
  • Constructor Details

    • TensorFactory

      public TensorFactory(Class tensorType)
  • Method Details

    • create

      public T create(int... shape)
    • randomM

      public T randomM(Random rand, boolean subTensor, int minibatch, int[] shape)
      Creates a random tensor with the specified shape and values from -1 to 1
      Parameters:
      rand - Random number generator
      subTensor - Should it be a sub-tensor or not?
      minibatch - Number of mini-batches
      shape - Shape of the tensor, without minibatch
      Returns:
      The random tensor
    • random

      public T random(Random rand, boolean subTensor, int... shape)
    • random

      public T random(Random rand, boolean subTensor, double min, double max, int... shape)
    • getTensorType

      public Class<T> getTensorType()