← 返回卡片

原书出处

Causal AI

核验版本的摘录快照 · 导入于 2026-11-14T08:43:24.514Z

def training_guide(self, img, digit, is_handwritten, batch_size): #1 pyro.module("encoder", self.encoder) #2 options = dict(dtype=torch.float32, device=DEVICE_TYPE) with pyro.plate("data", batch_size): #3 z_loc, z_scale = self.encoder(img, digit, is_handwritten) #4 normal_dist = dist.Normal(z_loc, z_scale).to_event(1) #4 z = pyro.sample("Z", normal_dist) #5 #1 training_guide is a method of the VAE that will use the encoder. #2 Register the encoder so Pyro is aware of its weight parameters. #3 This is the same

此预览只包含定位所需的摘录和上下文。

原书定位详情

来源:a19c7933-4eda-4176-aebd-30fe7e1ad292

正文位置:extracted/Causal AI/_epub-src/OEBPS/Text/chapter-5.xhtml

EPUB SHA-256:e55e7dc9d7966ea79311f2bc8d5bef7371a6dbb65240f11a2b3e44180b934e72