org.nd4j.linalg.ops.transforms

Class Transforms

• ```public class Transforms
extends Object```
Functional interface for the different op classes
Author:
• Constructor Summary

Constructors
Constructor and Description
`Transforms()`
• Method Summary

All Methods
Modifier and Type Method and Description
`static INDArray` `abs(INDArray ndArray)`
Abs funciton
`static INDArray` ```abs(INDArray ndArray, boolean dup)```
Abs function
`static INDArray` ```avgPooling(INDArray toPool, int[] stride)```
Pooled expectations(avg)
`static INDArray` `ceiling(INDArray ndArray)`
Binary matrix of whether the number at a given index is greater than
`static INDArray` ```ceiling(INDArray ndArray, boolean copyOnOps)```
Ceiling function
`static double` ```cosineSim(INDArray d1, INDArray d2)```
Cosine similarity
`static INDArray` ```downSample(INDArray d1, int[] stride)```
Down sampling a signal for the first stride dimensions
`static INDArray` `eps(INDArray ndArray)`
`static INDArray` ```eps(INDArray ndArray, boolean dup)```
Eps function
`static INDArray` `exp(INDArray ndArray)`
`static INDArray` ```exp(INDArray ndArray, boolean dup)```
Exp function
`static INDArray` `floor(INDArray ndArray)`
Binary matrix of whether the number at a given index is greater than
`static INDArray` ```floor(INDArray ndArray, boolean dup)```
Floor function
`static INDArray` ```greaterThanOrEqual(INDArray first, INDArray ndArray)```
1 if greater than or equal to 0 otherwise (at each element)
`static INDArray` ```greaterThanOrEqual(INDArray first, INDArray ndArray, boolean dup)```
Eps function
`static INDArray` `hardTanh(INDArray ndArray)`
`static INDArray` ```hardTanh(INDArray ndArray, boolean dup)```
Hard tanh
`static INDArray` `identity(INDArray ndArray)`
`static INDArray` ```identity(INDArray ndArray, boolean dup)```
Identity function
`static INDArray` ```lessThanOrEqual(INDArray first, INDArray ndArray)```
1 if less than or equal to 0 otherwise (at each element)
`static INDArray` ```lessThanOrEqual(INDArray first, INDArray ndArray, boolean dup)```
Eps function
`static INDArray` `log(INDArray ndArray)`
`static INDArray` ```log(INDArray ndArray, boolean dup)```
Log function
`static INDArray` ```max(INDArray ndArray, double k)```
Stabilize to be within a range of k
`static INDArray` ```max(INDArray ndArray, double k, boolean dup)```
Stabilize to be within a range of k
`static INDArray` ```maxPool(INDArray input, int[] ds, boolean ignoreBorder)```
Max pooling
`static INDArray` `neg(INDArray ndArray)`
Returns the negative of an ndarray
`static INDArray` ```neg(INDArray ndArray, boolean dup)```
Negative
`static INDArray` `normalizeZeroMeanAndUnitVariance(INDArray toNormalize)`
Normalize data to zero mean and unit variance substract by the mean and divide by the standard deviation
`static INDArray` ```pow(INDArray ndArray, Number power)```
Pow function
`static INDArray` ```pow(INDArray ndArray, Number power, boolean dup)```
Pow function
`static INDArray` `round(INDArray ndArray)`
Rounding function
`static INDArray` ```round(INDArray ndArray, boolean dup)```
Rounding function
`static INDArray` `sigmoid(INDArray ndArray)`
Sigmoid function
`static INDArray` ```sigmoid(INDArray ndArray, boolean dup)```
Sigmoid function
`static INDArray` `sign(INDArray toSign)`
Signum function of this ndarray
`static INDArray` ```sign(INDArray toSign, boolean dup)```
Signum function of this ndarray
`static INDArray` `sqrt(INDArray ndArray)`
Sqrt function
`static INDArray` ```sqrt(INDArray ndArray, boolean dup)```
Sqrt function
`static INDArray` ```stabilize(INDArray ndArray, double k)```
`static INDArray` ```stabilize(INDArray ndArray, double k, boolean dup)```
Stabilize to be within a range of k
`static INDArray` ```sumPooling(INDArray toPool, int[] stride)```
Pooled expectations(sum)
`static INDArray` `tanh(INDArray ndArray)`
Tanh function
`static INDArray` ```tanh(INDArray ndArray, boolean dup)```
Tanh function
`static INDArray` `unitVec(INDArray toScale)`
Scale by 1 / norm2 of the matrix
`static INDArray` ```upSample(INDArray d, INDArray scale)```
Upsampling a signal (specifically the first 2 dimensions)
• Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• Constructor Detail

• Transforms

`public Transforms()`
• Method Detail

• maxPool

```public static INDArray maxPool(INDArray input,
int[] ds,
boolean ignoreBorder)```
Max pooling
Parameters:
`input` -
`ds` - the strides with which to max pool expectations
Returns:
• downSample

```public static INDArray downSample(INDArray d1,
int[] stride)```
Down sampling a signal for the first stride dimensions
Parameters:
`d1` - the data to down sample
`stride` - the stride at which to downsample
Returns:
the down sampled ndarray
• avgPooling

```public static INDArray avgPooling(INDArray toPool,
int[] stride)```
Pooled expectations(avg)
Parameters:
`toPool` - the ndarray to sumPooling
`stride` - the 2d stride across the ndarray
Returns:
• sumPooling

```public static INDArray sumPooling(INDArray toPool,
int[] stride)```
Pooled expectations(sum)
Parameters:
`toPool` - the ndarray to sumPooling
`stride` - the 2d stride across the ndarray
Returns:
• upSample

```public static INDArray upSample(INDArray d,
INDArray scale)```
Upsampling a signal (specifically the first 2 dimensions)
Parameters:
`d` - the data to upsample
`scale` - the amount to scale by
Returns:
the upsampled ndarray
• cosineSim

```public static double cosineSim(INDArray d1,
INDArray d2)```
Cosine similarity
Parameters:
`d1` - the first vector
`d2` - the second vector
Returns:
the cosine similarities between the 2 arrays
• normalizeZeroMeanAndUnitVariance

`public static INDArray normalizeZeroMeanAndUnitVariance(INDArray toNormalize)`
Normalize data to zero mean and unit variance substract by the mean and divide by the standard deviation
Parameters:
`toNormalize` - the ndarray to normalize
Returns:
the normalized ndarray
• unitVec

`public static INDArray unitVec(INDArray toScale)`
Scale by 1 / norm2 of the matrix
Parameters:
`toScale` - the ndarray to scale
Returns:
the scaled ndarray
• neg

`public static INDArray neg(INDArray ndArray)`
Returns the negative of an ndarray
Parameters:
`ndArray` - the ndarray to take the negative of
Returns:
the negative of the ndarray
• floor

`public static INDArray floor(INDArray ndArray)`
Binary matrix of whether the number at a given index is greater than
Parameters:
`ndArray` -
Returns:
• ceiling

`public static INDArray ceiling(INDArray ndArray)`
Binary matrix of whether the number at a given index is greater than
Parameters:
`ndArray` -
Returns:
• ceiling

```public static INDArray ceiling(INDArray ndArray,
boolean copyOnOps)```
Ceiling function
Parameters:
`ndArray` -
`copyOnOps` -
Returns:
• sign

`public static INDArray sign(INDArray toSign)`
Signum function of this ndarray
Parameters:
`toSign` -
Returns:
• stabilize

```public static INDArray stabilize(INDArray ndArray,
double k)```
• abs

`public static INDArray abs(INDArray ndArray)`
Abs funciton
Parameters:
`ndArray` -
Returns:
• exp

`public static INDArray exp(INDArray ndArray)`
• hardTanh

`public static INDArray hardTanh(INDArray ndArray)`
• identity

`public static INDArray identity(INDArray ndArray)`
• pow

```public static INDArray pow(INDArray ndArray,
Number power)```
Pow function
Parameters:
`ndArray` - the ndarray to raise hte power of
`power` - the power to raise by
Returns:
the ndarray raised to this power
• round

`public static INDArray round(INDArray ndArray)`
Rounding function
Parameters:
`ndArray` -
Returns:
• sigmoid

`public static INDArray sigmoid(INDArray ndArray)`
Sigmoid function
Parameters:
`ndArray` -
Returns:
• sqrt

`public static INDArray sqrt(INDArray ndArray)`
Sqrt function
Parameters:
`ndArray` -
Returns:
• tanh

`public static INDArray tanh(INDArray ndArray)`
Tanh function
Parameters:
`ndArray` -
Returns:
• log

`public static INDArray log(INDArray ndArray)`
• eps

`public static INDArray eps(INDArray ndArray)`
• greaterThanOrEqual

```public static INDArray greaterThanOrEqual(INDArray first,
INDArray ndArray)```
1 if greater than or equal to 0 otherwise (at each element)
Parameters:
`first` -
`ndArray` -
Returns:
• lessThanOrEqual

```public static INDArray lessThanOrEqual(INDArray first,
INDArray ndArray)```
1 if less than or equal to 0 otherwise (at each element)
Parameters:
`first` -
`ndArray` -
Returns:
• lessThanOrEqual

```public static INDArray lessThanOrEqual(INDArray first,
INDArray ndArray,
boolean dup)```
Eps function
Parameters:
`ndArray` -
Returns:
• greaterThanOrEqual

```public static INDArray greaterThanOrEqual(INDArray first,
INDArray ndArray,
boolean dup)```
Eps function
Parameters:
`ndArray` -
Returns:
• eps

```public static INDArray eps(INDArray ndArray,
boolean dup)```
Eps function
Parameters:
`ndArray` -
Returns:
• floor

```public static INDArray floor(INDArray ndArray,
boolean dup)```
Floor function
Parameters:
`ndArray` -
Returns:
• sign

```public static INDArray sign(INDArray toSign,
boolean dup)```
Signum function of this ndarray
Parameters:
`toSign` -
Returns:
• max

```public static INDArray max(INDArray ndArray,
double k,
boolean dup)```
Stabilize to be within a range of k
Parameters:
`ndArray` - tbe ndarray
`k` -
`dup` -
Returns:
• max

```public static INDArray max(INDArray ndArray,
double k)```
Stabilize to be within a range of k
Parameters:
`ndArray` - tbe ndarray
`k` -
Returns:
• stabilize

```public static INDArray stabilize(INDArray ndArray,
double k,
boolean dup)```
Stabilize to be within a range of k
Parameters:
`ndArray` - tbe ndarray
`k` -
`dup` -
Returns:
• abs

```public static INDArray abs(INDArray ndArray,
boolean dup)```
Abs function
Parameters:
`ndArray` -
`dup` -
Returns:
• exp

```public static INDArray exp(INDArray ndArray,
boolean dup)```
Exp function
Parameters:
`ndArray` -
`dup` -
Returns:
• hardTanh

```public static INDArray hardTanh(INDArray ndArray,
boolean dup)```
Hard tanh
Parameters:
`ndArray` - the input
`dup` - whether to duplicate the ndarray and return it as the result
Returns:
the output
• identity

```public static INDArray identity(INDArray ndArray,
boolean dup)```
Identity function
Parameters:
`ndArray` -
`dup` -
Returns:
• pow

```public static INDArray pow(INDArray ndArray,
Number power,
boolean dup)```
Pow function
Parameters:
`ndArray` -
`power` -
`dup` -
Returns:
• round

```public static INDArray round(INDArray ndArray,
boolean dup)```
Rounding function
Parameters:
`ndArray` - the ndarray
`dup` -
Returns:
• sigmoid

```public static INDArray sigmoid(INDArray ndArray,
boolean dup)```
Sigmoid function
Parameters:
`ndArray` -
`dup` -
Returns:
• sqrt

```public static INDArray sqrt(INDArray ndArray,
boolean dup)```
Sqrt function
Parameters:
`ndArray` -
`dup` -
Returns:
• tanh

```public static INDArray tanh(INDArray ndArray,
boolean dup)```
Tanh function
Parameters:
`ndArray` -
`dup` -
Returns:
• log

```public static INDArray log(INDArray ndArray,
boolean dup)```
Log function
Parameters:
`ndArray` -
`dup` -
Returns:
• neg

```public static INDArray neg(INDArray ndArray,
boolean dup)```
Negative
Parameters:
`ndArray` -
`dup` -
Returns: