Skip to content

random_seed in sample_vp does not fix the results #1656

@aloctavodia

Description

@aloctavodia

I am observing a weird behavior with random_seed in variational.sample_vp

with pm.Model() as model:
    mu = pm.Normal('mu', 0, 1)
    sd = pm.Uniform('sd', 0, 1)
    v_params = pm.variational.advi(n=1000, random_seed=1)
    start = pm.variational.sample_vp(v_params, 1, progressbar=False, hide_transformed=False,
                                     random_seed=1)
    print(v_params.means, start[0])

v_params.means is always

{'mu': array(0.0020075358649095402), 'sd_interval_': array(0.009411317153529386)}

but start[0] switch between two sets of values

{'sd': 0.15213536777333242, 'mu': -0.30831562426121062, 'sd_interval_': -1.7179502892676166}

or

{'sd': 0.41065146913471795, 'mu': -1.4440759392611413, 'sd_interval_': -0.36127289410088403}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions