Skip to content

Commit

Permalink
🩹 Fix missing import
Browse files Browse the repository at this point in the history
  • Loading branch information
francois-rozet committed May 24, 2022
1 parent 53df6a7 commit 40f6a94
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions lampe/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import torch.nn as nn
import torch.nn.functional as F

from itertools import islice
from torch import Tensor, BoolTensor, Size
from typing import *

Expand Down
2 changes: 1 addition & 1 deletion notebooks/01_npe.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"metadata": {},
"outputs": [],
"source": [
"loader = JointLoader(prior, sim, numpy=False, batched=True)"
"loader = JointLoader(prior, sim, batch_size=2**10, numpy=False, batched=True)"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions notebooks/02_nre.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
" loader = JointLoader(prior, sim, batched=True)\n",
" H5Dataset.store(loader, 'train.h5', size=2**20) # store 1048576 pairs on disk\n",
"\n",
"dataset = H5Dataset('train.h5', batch_size=2**10, pin_memory=True)\n",
"dataset = H5Dataset('train.h5', batch_size=2**10, shuffle=True, pin_memory=True)\n",
"dataset[0]"
]
},
Expand Down Expand Up @@ -203,7 +203,7 @@
"x_star = sim(theta_star).cuda()\n",
"\n",
"estimator.eval()\n",
"deepto(prior, device='cuda')\n",
"deepto(prior, device='cuda') # move internal tensors to CUDA\n",
"\n",
"with torch.no_grad():\n",
" theta_0 = prior.sample((2**12,)) # 4096 concurrent Markov chains\n",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setuptools.setup(
name='lampe',
version='0.4.1',
version='0.4.2',
packages=setuptools.find_packages(),
description='Likelihood-free AMortized Posterior Estimation with PyTorch',
keywords='parameter inference bayes posterior amortized likelihood ratio mcmc torch',
Expand Down

0 comments on commit 40f6a94

Please sign in to comment.