pymc-devs / pymc-devs/nutpie

Store_mass_matrix in low rank adapt mode

Open
#185 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
207
Forks
28
Avg merge
7d 21h
Merged PRs (30d)
1

Description

The code

code = """
stan_model
"""

compiled = nutpie.compile_stan_model(code=code)
compiled = compiled.with_data(mu=3.)
trace = nutpie.sample(compiled, save_warmup=True, low_rank_modified_mass_matrix=True, store_mass_matrix=True)

raises ValueError: cannot reshape array of size 0 into shape (1800,)

from

--> 407 return _trace_to_arviz(
408 results,
409 self._settings.num_tune,
...
--> 115 data[i, : len(chunk)] = values.reshape((len(chunk), *last_shape))
116 stats_dict[name] = data[:, n_tune:]
117 stats_dict_tune[name] = data[:, :n_tune]

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with nutpie.compile_stan_model, compiled.with_data, and nutpie.sample using low_rank_modified_mass_matrix=True and store_mass_matrix=True. Start at _trace_to_arviz and the data[i, : len(chunk)] assignment shown in the traceback; done means this combination completes without the reshape error and preserves the requested mass-matrix output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.