_zscore
zscore
¶
Apply Zscore processing to a given tensor or array.
This method can be used with Numpy data:
n = np.array([[0,1],[2,3]])
b = fe.backend.zscore(n) # [[-1.34164079, -0.4472136 ],[0.4472136 , 1.34164079]]
This method can be used with TensorFlow tensors:
t = tf.constant([[0,1],[2,3]])
b = fe.backend.zscore(t) # [[-1.34164079, -0.4472136 ],[0.4472136 , 1.34164079]]
This method can be used with PyTorch tensors:
p = torch.tensor([[0,1],[2,3]])
b = fe.backend.zscore(p) # [[-1.34164079, -0.4472136 ],[0.4472136 , 1.34164079]]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Tensor
|
The input tensor or array. |
required |
epsilon |
float
|
A numerical stability constant. |
1e-07
|
Returns:
Type | Description |
---|---|
Tensor
|
Data after subtracting mean and divided by standard deviation. |
Raises:
Type | Description |
---|---|
ValueError
|
If |