From c5fcb0b6d34b3c8efea6f6dc21d73e0e91287d9f Mon Sep 17 00:00:00 2001 From: Nicolas Chopin Date: Fri, 1 Sep 2023 17:24:34 +0200 Subject: [PATCH] Getting ready for version 0.4 --- CHANGELOG | 3 ++- README.md | 4 ++-- .../complexity_smoothing/mle_neuro_nrsteps.py | 17 +++++------------ 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 51a4969..b01c9d4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,7 +2,8 @@ All notable changes to this project will be documented in this file. -## [Unreleased] +## [0.4] - 2023-09-01 +# Blog post: TBA ### Added - nested: NS-SMC sampler of Salomone et al (2018) - datasets: Liver diff --git a/README.md b/README.md index 84c06de..4ae492d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ +![logo](logo.png) + # particles # Sequential Monte Carlo in python. -![logo](logo.png) - ## Motivation ## This package was developed to complement the following book: diff --git a/papers/complexity_smoothing/mle_neuro_nrsteps.py b/papers/complexity_smoothing/mle_neuro_nrsteps.py index 2bd3bda..ceaec81 100644 --- a/papers/complexity_smoothing/mle_neuro_nrsteps.py +++ b/papers/complexity_smoothing/mle_neuro_nrsteps.py @@ -9,19 +9,12 @@ """ -import itertools import time -import pickle -import matplotlib -import numpy as np from matplotlib import pyplot as plt import seaborn as sb import particles -from particles import datasets as dts -from particles import distributions as dists -from particles import state_space_models as ssms import mle_neuro @@ -29,21 +22,21 @@ def worker(rho0=0.1, sig20=0.5, N=10, ffbs='mcmc', maxiter=1, mcmc_steps=1): tic = time.perf_counter() results = mle_neuro.EM(rho0, sig20, N=N, maxiter=maxiter, xatol=0., ffbs=ffbs, mcmc_steps=mcmc_steps) + results['cpu_time'] = time.perf_counter() - tic results['ffbs'] = ffbs results['mcmc_steps'] = mcmc_steps - cpu_time = time.perf_counter() - tic - results['cpu_time'] = cpu_time return results nruns = 100 maxiter = 20 -N = 1000 # TODO was 100 +N = 1000 nsteps = [1, 3] results = particles.utils.multiplexer(f=worker, N=N, maxiter=maxiter, - mcmc_steps=nsteps, nruns=nruns, nprocs=0) + mcmc_steps=nsteps, nruns=nruns, nprocs=1) +ref_method = 'hybrid' # replace by 'pureject' to see improvement over book xp ref_results = particles.utils.multiplexer(f=worker, N=N, maxiter=maxiter, - ffbs='hybrid', nruns=nruns, nprocs=0) + ffbs=ref_method, nruns=nruns, nprocs=1) results.extend(ref_results) flat_res = []