Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmarks #8

Merged
merged 25 commits into from
May 22, 2016
Merged

Benchmarks #8

merged 25 commits into from
May 22, 2016

Conversation

adscib
Copy link
Contributor

@adscib adscib commented May 12, 2016

This branch is not ready to merge yet!

Here's my proposal for how to set up benchmarks #7. We define a bunch of models in examples/ folder, each of which comes with appropriate performance metrics and a function that evaluates them all given a chain of samples from inference. On top of that there is a benchmarking script that runs the inference algorithm and measures execution time. We'll probably want it to supply an option to run the experiments multiple times and summarize the results. Finally, we can set up some notebooks to create custom plots for specific models.

Here's an example for how this would work on the Anglican Gaussian model. I know the plots are horrible, this is just to illustrate the setup. Any comments?

@yebai
Copy link
Member

yebai commented May 12, 2016

Looks good - I only have two organisational comments:

  • Use a Benchmarking package, e.g. BenchmarkLite.
  • It might be helpful to modify the travis.yml file to automatically execute the benchmarking script (maybe only for one simple model to keep testing time sensible)

@adscib
Copy link
Contributor Author

adscib commented May 14, 2016

Anglican examples are ready. I'll make some nice plots tomorrow. I also added a function localcopy that converts TArray into Array. I'm open to suggestions for a better name for it.

@yebai
Copy link
Member

yebai commented May 15, 2016

Cool - It seems that the purpose of localcopy is similar with Base.get (see tarray.jl). One minor difference is that Base.get does not deepcopy the data.

@yebai yebai closed this May 16, 2016
@yebai yebai reopened this May 16, 2016
@yebai yebai closed this May 16, 2016
@yebai yebai reopened this May 16, 2016
# Conflicts:
#	README.md
@adscib
Copy link
Contributor Author

adscib commented May 17, 2016

Why does Base.get take a task as an argument?

@yebai yebai closed this May 17, 2016
@yebai yebai reopened this May 17, 2016
@yebai
Copy link
Member

yebai commented May 17, 2016

There are cases when Base.get is called by another task, e.g., in each sampler, we need to collect result after sampling is completed, then we need to call Base.get(particle_task, var).

@yebai yebai closed this May 17, 2016
@yebai
Copy link
Member

yebai commented May 17, 2016

I am noticing a strange behaviour with GitHub, whenever I create a breach from master, this PR get closed automatically and I have to re-open it. Sorry for the trouble!

@yebai yebai reopened this May 17, 2016
@adscib
Copy link
Contributor Author

adscib commented May 17, 2016

I'm having some trouble with TArray. Could you take a look at the latest version of examples/anglican_crp.jl and see if I'm using something incorrectly (including the PolyaUrn definition in examples/utils.jl)? I'm getting "access to undefined reference" error.

@yebai
Copy link
Member

yebai commented May 17, 2016

I've fixed the bug in anglican_crp. The bug is due to the following line

  clusters = TArray{Distribution}(1)

will create an Array of length 1, but this only element is not initialised (null). The correct code should be

  clusters = TArray{Distribution}(0)

then clusters is of length 0, and will be expanded when new cluster is created.

@adscib
Copy link
Contributor Author

adscib commented May 17, 2016

KL plots for Anglican models are not looking good. Gaussian is OK, but SMC doesn't produce good results for HMM and CRP. At this point I have no idea what is the problem.

@yebai
Copy link
Member

yebai commented May 18, 2016

I've fixed the hmm model (see the commit). I couldn't find any problem with the crp model: it seems our sampler is converging to a consistent result. This makes me think that there might be a mis-match between our crp implementation and the anglican version. I will take a closer look tomorrow.

@yebai yebai merged commit 6876bd3 into development May 22, 2016
@yebai yebai deleted the benchmarks branch May 22, 2016 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants