Skip to content

Commit

Permalink
Getting ready for version 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nchopin committed Sep 1, 2023
1 parent 38d1a6f commit c5fcb0b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
17 changes: 5 additions & 12 deletions papers/complexity_smoothing/mle_neuro_nrsteps.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,34 @@
"""


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

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 = []
Expand Down

0 comments on commit c5fcb0b

Please sign in to comment.