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 66class AsSet (ElementwiseTransform ):
77 """
88 The `.as_set(["x", "y"])` transform indicates that both `x` and `y` are treated as sets.
9+ <<<<<<< HEAD
910 That is, their values will be treated as *exchangable* such that they will imply the same inference regardless of
1011 the values' order. This would be useful in a linear regression context where we can index the observations in
1112 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
1219
1320 Useage:
1421
Original file line number Diff line number Diff line change 1212
1313@serializable (package = "bayesflow.adapters" )
1414class Concatenate (Transform ):
15+ < << << << HEAD
1516 """Concatenate multiple arrays into a new key. Used to specify how data variables should be treated by the network.
1617
1718 Parameters:
@@ -23,6 +24,14 @@ class Concatenate(Transform):
2324 Example:
2425 Suppose you have a simulator that generates variables beta, sigma from priors and then observation
2526 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
2635
2736 adapter = (
2837 bf .Adapter ()
Original file line number Diff line number Diff line change @@ -32,17 +32,20 @@ class Constrain(ElementwiseTransform):
3232
3333
3434 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.
3637
38+ Useage:
3739 Useage:
3840 adapter = (
3941 bf.Adapter()
4042 .constrain("sigma", lower=0)
4143 )
4244
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.
4547
48+ Usage:
4649 Usage:
4750 adapter = (
4851 bf.Adapter()
Original file line number Diff line number Diff line change @@ -25,8 +25,12 @@ class Keep(Transform):
2525
2626 adapter = (
2727 bf.adapters.Adapter()
28+ <<<<<<< HEAD
2829
2930 # drop data from unneeded priors alpha, and r
31+ =======
32+ # only keep theta and x
33+ >>>>>>> b8b68757b0ae1a5f34bf656a837abbeb77e2ec62
3034 .keep(("theta", "x"))
3135 )
3236
You can’t perform that action at this time.
0 commit comments