Please link or paste relevant code, and steps to reproduce.
For any enumerated variable x , the set of all enumerated variables on which x depends must be linearly orderable in their vectorized plate nesting.
Could anybody help me understand what linearly orderable means. In the example code, i think that because x and y is defined under different plates, they are orderable by plate dim?
@config_enumerate
def invalid_model(data):
plate_1 = pyro.plate(“plate_1”, 10, dim=-1) # vectorized
plate_2 = pyro.plate(“plate_2”, 10, dim=-2) # vectorized
with plate_1:
x = pyro.sample(“y”, dist.Bernoulli(0.5))
with plate_2:
y = pyro.sample(“x”, dist.Bernoulli(0.5))
with plate_1, plate2:
z = pyro.sample(“z”, dist.Bernoulli((1. + x + y) / 4.))
I found the definition of a linearly ordered set here. My understanding is that here we are comparing the sets of plates themselves ({plate_1} fo x and {plate_2} for y) not their dimensions. Since it is not possible to compare {plate_1} and {plate_2} this breaks the Comparability property in the definition of a linearly ordered set.
For any enumerated variable x , the set of all enumerated variables on which x depends must be linearly orderable in their vectorized plate nesting
Still confused.
I tried the model myself, and found that when i remove variable z’s plate, the code didn’t raise exception. This means that at least the above paragraph might need some modification?
with plate1:
x = pyro.sample("x", ...) # enumerated
with plate2:
y = pyro.sample("y", ...) # enumerated
z = pyro.sample("z", dist.Bernoulli((1. + x + y) / 4.))
Here z depends on x (nested in {plate1}) and y (nested in {plate1, plate2}) enumerated variables. {plate1} is a subset of {plate1,plate2} so we can order them: {plate1} =< {plate1,plate2}.
Example 2
with plate1:
x = pyro.sample("x", ...) # enumerated
y = pyro.sample("y", ...) # enumerated
with plate2:
z = pyro.sample("z", dist.Bernoulli((1. + x + y) / 4.))
Here z depends on x (nested in {plate1}) and y (nested in {plate1}) enumerated variables. {plate1} is equal to {plate1} so we can order them: {plate1} = {plate1}.