Model initialized as model = MMM( ..., saturation=MichaelisMentenSaturation(), ...)
Then, after calling model.fit(X=X, y=y, ...), model.sample_posterior_predictive(X), we try to plot the direct contributions by channel with model.plot_direct_contribution_curves(show_fit=True, ...):
AttributeError: 'numpy.ndarray' object has no attribute 'eval'
The issue arises from the call to _plot_response_curve_fit trying to evaluate a pytensor.tensor.TensorVariable in L1671, L1675, and L1678.
Note that MichaelisMentenSaturation.function currently returns float | Any, contrary to other transformations
Hacky fix: comment .eval().
Better fix: modify michaelis_menten to return pytensor.tensor.TensorVariable
Model initialized as
model = MMM( ..., saturation=MichaelisMentenSaturation(), ...)
Then, after calling
model.fit(X=X, y=y, ...)
,model.sample_posterior_predictive(X)
, we try to plot the direct contributions by channel withmodel.plot_direct_contribution_curves(show_fit=True, ...)
:AttributeError: 'numpy.ndarray' object has no attribute 'eval'
The issue arises from the call to
_plot_response_curve_fit
trying to evaluate apytensor.tensor.TensorVariable
in L1671, L1675, and L1678.Note that
MichaelisMentenSaturation.function
currently returnsfloat | Any
, contrary to other transformations.eval()
.michaelis_menten
to returnpytensor.tensor.TensorVariable
I'll try to open a PR with solution (2) soon