File tree Expand file tree Collapse file tree 4 files changed +26
-3
lines changed
bayesflow/adapters/transforms Expand file tree Collapse file tree 4 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 6
6
class AsSet (ElementwiseTransform ):
7
7
"""
8
8
The `.as_set(["x", "y"])` transform indicates that both `x` and `y` are treated as sets.
9
+ <<<<<<< HEAD
9
10
That is, their values will be treated as *exchangable* such that they will imply the same inference regardless of
10
11
the values' order. This would be useful in a linear regression context where we can index the observations in
11
12
arbitrary order and always get the same regression line.
13
+ =======
14
+ That is, their values will be treated as *exchangable* such that they will imply
15
+ the same inference regardless of the values' order.
16
+ This is useful, for example, in a linear regression context where we can index
17
+ the observations in arbitrary order and always get the same regression line.
18
+ >>>>>>> b8b68757b0ae1a5f34bf656a837abbeb77e2ec62
12
19
13
20
Useage:
14
21
Original file line number Diff line number Diff line change 12
12
13
13
@serializable (package = "bayesflow.adapters" )
14
14
class Concatenate (Transform ):
15
+ < << << << HEAD
15
16
"""Concatenate multiple arrays into a new key. Used to specify how data variables should be treated by the network.
16
17
17
18
Parameters:
@@ -23,6 +24,14 @@ class Concatenate(Transform):
23
24
Example:
24
25
Suppose you have a simulator that generates variables beta, sigma from priors and then observation
25
26
variables "x" and "y". We can then use concatonate in the following way
27
+ =======
28
+ """ Concatenate multiple arrays into a new key .
29
+ Parameters :
30
+
31
+ keys :
32
+
33
+ into :
34
+ >> >> >> > b8b68757b0ae1a5f34bf656a837abbeb77e2ec62
26
35
27
36
adapter = (
28
37
bf .Adapter ()
Original file line number Diff line number Diff line change @@ -32,17 +32,20 @@ class Constrain(ElementwiseTransform):
32
32
33
33
34
34
Examples:
35
- Let sigma be the standard deviation of a normal distribution, then sigma should always be greater than zero.
35
+ Let sigma be the standard deviation of a normal distribution,
36
+ then sigma should always be greater than zero.
36
37
38
+ Useage:
37
39
Useage:
38
40
adapter = (
39
41
bf.Adapter()
40
42
.constrain("sigma", lower=0)
41
43
)
42
44
43
- Suppose p is the parameter for a binomial distribution where p must be in [0,1] then we would constrain the
44
- neural network to estimate p in the following way
45
+ Suppose p is the parameter for a binomial distribution where p must be in [0,1]
46
+ then we would constrain the neural network to estimate p in the following way.
45
47
48
+ Usage:
46
49
Usage:
47
50
adapter = (
48
51
bf.Adapter()
Original file line number Diff line number Diff line change @@ -25,8 +25,12 @@ class Keep(Transform):
25
25
26
26
adapter = (
27
27
bf.adapters.Adapter()
28
+ <<<<<<< HEAD
28
29
29
30
# drop data from unneeded priors alpha, and r
31
+ =======
32
+ # only keep theta and x
33
+ >>>>>>> b8b68757b0ae1a5f34bf656a837abbeb77e2ec62
30
34
.keep(("theta", "x"))
31
35
)
32
36
You can’t perform that action at this time.
0 commit comments