Here is the backtrace (for the first of three consecutive exceptions) if you insist:
---------------------------------------------------------------------------
RemoteTraceback Traceback (most recent call last)
RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/pytensor/compile/function/types.py", line 1037, in __call__
outputs = vm() if output_subset is None else vm(output_subset=output_subset)
~~^^
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/pytensor/graph/op.py", line 531, in rval
r = p(n, [x[0] for x in i], o)
File "/home/emile/Ling/Postdoc-ZAS/Number (SM)/numeral-production/grammar.py", line 324, in perform
assert len(inputs[2]) == inputs[0].sum() + inputs[1].sum() + self.grammar_set.n_extra_dims, "incoherent input sizes"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: incoherent input sizes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/pymc/sampling/parallel.py", line 154, in run
self._start_loop()
~~~~~~~~~~~~~~~~^^
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/pymc/sampling/parallel.py", line 211, in _start_loop
point, stats = self._step_method.step(self._point)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/pymc/step_methods/compound.py", line 276, in step
point, sts = method.step(point)
~~~~~~~~~~~^^^^^^^
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/pymc/step_methods/arraystep.py", line 116, in step
apoint, stats = self.astep(q)
~~~~~~~~~~^^^
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/pymc/step_methods/metropolis.py", line 301, in astep
accept_rate_i = self.delta_logp(q_temp, q0d)
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/pytensor/compile/function/types.py", line 1047, in __call__
raise_with_op(
~~~~~~~~~~~~~^
self.maker.fgraph,
^^^^^^^^^^^^^^^^^^
...<2 lines>...
storage_map=getattr(self.vm, "storage_map", None),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/pytensor/link/utils.py", line 526, in raise_with_op
raise exc_value.with_traceback(exc_trace)
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/pytensor/compile/function/types.py", line 1037, in __call__
outputs = vm() if output_subset is None else vm(output_subset=output_subset)
~~^^
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/pytensor/graph/op.py", line 531, in rval
r = p(n, [x[0] for x in i], o)
File "/home/emile/Ling/Postdoc-ZAS/Number (SM)/numeral-production/grammar.py", line 324, in perform
assert len(inputs[2]) == inputs[0].sum() + inputs[1].sum() + self.grammar_set.n_extra_dims, "incoherent input sizes"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: incoherent input sizes
Apply node that caused the error: GrammarSetOp{grammar_set_id=139887627014288, method='combinatorial'}(inarray1, prim_set_shared, Composite{((10.0 * sigmoid(i0)) + (0.1 * (1.0 - sigmoid(i0))))}.0)
Toposort index: 10
Inputs types: [TensorType(int64, shape=(19,)), TensorType(int64, shape=(39,)), TensorType(float64, shape=(None,))]
Inputs shapes: [(19,), (39,), (2,)]
Inputs strides: [(8,), (8,), (8,)]
Inputs values: ['not shown', 'not shown', array([5.05, 5.05])]
Outputs clients: [[ExpandDims{axis=1}(GrammarSetOp{grammar_set_id=139887627014288, method='combinatorial'}.0)], []]
Backtrace when the node is created (use PyTensor flag traceback__limit=N to make it longer):
File "<ipython-input-3-d92932096aff>", line 1, in <module>
get_ipython().run_line_magic('run', 'numeral-production/pymc_poc_inline.py data_ngram_full.csv -c en-2019 -m 100 -w 100 --start 1 --algo metropolis --opt-method combinatorial -d 100 -t 100')
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/IPython/core/interactiveshell.py", line 2486, in run_line_magic
result = fn(*args, **kwargs)
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/IPython/core/magics/execution.py", line 860, in run
run()
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/IPython/core/magics/execution.py", line 845, in run
runner(filename, prog_ns, prog_ns,
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/IPython/core/pylabtools.py", line 230, in mpl_execfile
safe_execfile(fname, *where, **kw)
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/IPython/core/interactiveshell.py", line 2904, in safe_execfile
py3compat.execfile(
File "/home/emile/Dev/python/miniforge3/envs/pymc/lib/python3.13/site-packages/IPython/utils/py3compat.py", line 56, in execfile
exec(compiler(f.read(), fname, "exec"), glob, loc)
File "/home/emile/Ling/Postdoc-ZAS/Number (SM)/numeral-production/pymc_poc_inline.py", line 105, in <module>
costs = pm.Deterministic("costs", grammar_set_op(constant_set, prim_set, cost_weight)[0])
HINT: Use the PyTensor flag `exception_verbosity=high` for a debug print-out and storage map footprint of this Apply node.
"""