BUG: constant_data is missing from idata when sampling with nutpie

Đang mở
#74 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
data

Hướng nghiên cứu

Bắt đầu với mô hình có thể tái lập được đã cung cấp và so sánh các nhóm idata được tạo bởi nuts_sampler="pymc" và nuts_sampler="nutpie". Điều tra cách pm.ConstantData() được biểu diễn trong quá trình lấy mẫu bằng nutpie; công việc được xem là hoàn thành khi kết quả nutpie bao gồm nhóm constant_data như mong đợi, chứa x và y.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
Describe the issue:

I recently encountered an issue when trying to add constant data to some of my models.
When sampling with nuts_sampler="pymc", idata contains a group denominated as constant_data where x and y from this toy example are stored. Unfortunately, when using nutpie, the constant data is nowhere to be found.
Is this actually a bug or is there something wrong with my definitions? Or are pm.ConstantData() and such perhaps just not supported when using nutpie?
Any help would be much appreciated.

Reproduceable code example:
import numpy as np
import pymc as pm
import pytensor.tensor as pt

x = np.array([1,2,3,4])
y = np.array([100, 190, 310, 405])

with pm.Model() as pmodel:
    # add data to the pmodel as ConstantData
    pm.ConstantData("x", x)
    pm.ConstantData("y", y)

    var = pm.Normal("var", 100, 5)
    
    # likelihood
    pm.Normal("L", mu=y, sigma=0.1, observed=y)
    # posterior
    pst = x * var
    pst = pm.Deterministic("posterior", pst)
    # sampling
    idata = pm.sample(nuts_sampler="nutpie", tune=50, draws=50)

print(idata)
Error message:

Output of print(idata):

Inference data with groups:
	> posterior
	> sample_stats

Warmup iterations saved (warmup_*).
PyMC version information:

PyMC v5.8.1 (pypi)
nutpie v0.9.1 (pypi)
PyTensor v2.16.2 (pypi)

Context for the issue:

No response

Ngôn ngữ chính
Python
Star
214
Fork
30
Merge trung bình
3 giờ 50 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pymc-devs/nutpie

Tất cả issue của pymc-devs/nutpie

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.