Skip to content

Commit 0e2c443

Browse files
committed
added docs for standardize and one_hot
1 parent c5a3267 commit 0e2c443

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

bayesflow/adapters/transforms/one_hot.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
@serializable(package="bayesflow.adapters")
1111
class OneHot(ElementwiseTransform):
12+
"""
13+
Changes data to be one-hot encoded.
14+
"""
15+
1216
def __init__(self, num_classes: int):
1317
super().__init__()
1418
self.num_classes = num_classes

bayesflow/adapters/transforms/standardize.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@
1010

1111
@serializable(package="bayesflow.adapters")
1212
class Standardize(ElementwiseTransform):
13+
"""
14+
Transform that when applied standardizes data using typical z-score standardization i.e. for some unstandardized data
15+
x the standardized version z would be
16+
17+
z = (x - mean(x))/std(x)
18+
19+
Parameters:
20+
mean: integer or float used to specify a mean if known but will be estimated from data when not provided
21+
std: integer or float used to specify a standard devation if known but will be estimated from data when not provided
22+
axis: integer representing a specific axis along which standardization should take place. By default
23+
standardization happens individually for each dimension
24+
momentum: float in (0,1) specifying the momentum during training
25+
26+
"""
27+
1328
def __init__(
1429
self,
1530
mean: int | float | np.ndarray = None,

0 commit comments

Comments
 (0)