Skip to content

Commit df15fe2

Browse files
committed
add n_draws and t_sampling report to smc
1 parent 9e8a20d commit df15fe2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: pymc3/smc/sample_smc.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from .smc import SMC
15+
import time
1616
import logging
17+
from .smc import SMC
1718

1819

1920
def sample_smc(
@@ -144,6 +145,7 @@ def sample_smc(
144145
random_seed=random_seed,
145146
)
146147

148+
t1 = time.time()
147149
_log = logging.getLogger("pymc3")
148150
_log.info("Sample initial stage: ...")
149151
stage = 0
@@ -170,5 +172,6 @@ def sample_smc(
170172
smc.pool.join()
171173

172174
trace = smc.posterior_to_trace()
173-
175+
trace.report._n_draws = smc.draws
176+
trace.report._t_sampling = time.time() - t1
174177
return trace

0 commit comments

Comments
 (0)