Package deepnetts.tensor
Class Tensor3D
java.lang.Object
deepnetts.tensor.TensorBase
deepnetts.tensor.Tensor3D
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
add
(float value, int z, int row, int col) float
channelMean
(int ch) final int
cols()
copy()
final void
copy2DSubChannel
(int ch, float[] buff) Copies 2D channel values from this tensor into given float array buffer.final int
depth()
void
divChannel
(float val, int ch) static Tensor3D
final float
get
(int ch, int row, int col) final int
rows()
final void
set
(float val, int ch, int row, int col) void
setRow
(float[] rowData, int depthIdx, int rowIdx) final void
sub
(float val, int z, int row, int col) toString()
Methods inherited from class deepnetts.tensor.TensorBase
add, add, addInto, apply, apply, clone, copyFrom, copyFrom, copyFromGPU, copyToGPU, createAcceleratorBridge, div, div, div, equals, equals, fill, getAcceleratorBridge, getOrCreateAccBridge, getValues, hashCode, mean, multiply, multiply, multiplyElementWise, numDimensions, numElements, randomize, replace, setValues, setValuesFromString, setValuesFromStringTransposed, shape, sqr, sqrt, std, sub, sub, subInplace, subInto, sum, sumAbs, sumSqr, valuesAsString
-
Constructor Details
-
Tensor3D
public Tensor3D(int depth, int rows, int cols) Creates a 3D tensor with specified number of rows, cols and depth.- Parameters:
depth
- tensor depthrows
- number of rowscols
- number of columns
-
Tensor3D
public Tensor3D(float[][][] vals) Creates a 3D tensor from specified 3D array- Parameters:
vals
- 2D array of tensor values
-
Tensor3D
public Tensor3D(int depth, int rows, int cols, float[] values)
-
-
Method Details
-
get
public final float get(int ch, int row, int col) -
set
public final void set(float val, int ch, int row, int col) -
add
public final void add(float value, int z, int row, int col) -
sub
public final void sub(float val, int z, int row, int col) -
copy
- Overrides:
copy
in classTensorBase
-
cols
public final int cols() -
rows
public final int rows() -
depth
public final int depth() -
copy2DSubChannel
public final void copy2DSubChannel(int ch, float[] buff) Copies 2D channel values from this tensor into given float array buffer. Used on 3D tensors.- Parameters:
ch
- tensor channel to copybuff
- buffer to copy values into
-
setRow
public void setRow(float[] rowData, int depthIdx, int rowIdx) -
channelMean
public float channelMean(int ch) -
divChannel
public void divChannel(float val, int ch) -
fromFile
- Throws:
IOException
-
toString
- Overrides:
toString
in classTensorBase
-