You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm one of the reviewers for the JOSS paper you submitted, so here I'll list my questions and concerns about the code itself. This issue will be updated as my reading progresses so maybe don't start answering right away.
Warning
I am not a Python developer, my main language is Julia, so I won't be able to give much advice beyond what I observed when trying out the examples. In addition, I don't know the best practices in terms of package and version management, I just use mamba and then pip inside the mamba environment.
Design
Execution
Tests
I followed the testing workflow on the home page of the documentation and it yielded one failure.
When I try to run the tutorial notebook after naive installation, it fails to generate sample data due to a Numpy 2.0 breaking change. I'm not sure why pip allowed me to install Numpy 2.0 as a dependency, since it doesn't seem to be supported yet (#366).
AttributeErrorTraceback (mostrecentcalllast)
CellIn[5], [line22](vscode-notebook-cell:?execution_count=5&line=22)
[15](vscode-notebook-cell:?execution_count=5&line=15) emission_means=jnp.column_stack([
[16](vscode-notebook-cell:?execution_count=5&line=16) jnp.cos(jnp.linspace(0, 2*jnp.pi, true_num_states+1))[:-1],
[17](vscode-notebook-cell:?execution_count=5&line=17) jnp.sin(jnp.linspace(0, 2*jnp.pi, true_num_states+1))[:-1],
[18](vscode-notebook-cell:?execution_count=5&line=18) jnp.zeros((true_num_states, emission_dim-2)),
[19](vscode-notebook-cell:?execution_count=5&line=19) ])
[20](vscode-notebook-cell:?execution_count=5&line=20) emission_covs=jnp.tile(0.1**2*jnp.eye(emission_dim), (true_num_states, 1, 1))
---> [22](vscode-notebook-cell:?execution_count=5&line=22) true_params, _=hmm.initialize(initial_probs=initial_probs,
[23](vscode-notebook-cell:?execution_count=5&line=23) transition_matrix=transition_matrix,
[24](vscode-notebook-cell:?execution_count=5&line=24) emission_means=emission_means,
[25](vscode-notebook-cell:?execution_count=5&line=25) emission_covariances=emission_covs)
[27](vscode-notebook-cell:?execution_count=5&line=27) # Sample train, validation, and test data
[28](vscode-notebook-cell:?execution_count=5&line=28) train_key, val_key, test_key=jr.split(jr.PRNGKey(0), 3)
File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/hidden_markov_model/models/gaussian_hmm.py:651, inGaussianHMM.initialize(self, key, method, initial_probs, transition_matrix, emission_means, emission_covariances, emissions)
[649](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/hidden_markov_model/models/gaussian_hmm.py:649) params["initial"], props["initial"] =self.initial_component.initialize(key1, method=method, initial_probs=initial_probs)
[650](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/hidden_markov_model/models/gaussian_hmm.py:650) params["transitions"], props["transitions"] =self.transition_component.initialize(key2, method=method, transition_matrix=transition_matrix)
--> [651](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/hidden_markov_model/models/gaussian_hmm.py:651) params["emissions"], props["emissions"] =self.emission_component.initialize(key3, method=method, emission_means=emission_means, emission_covariances=emission_covariances, emissions=emissions)
[652](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/hidden_markov_model/models/gaussian_hmm.py:652) returnParamsGaussianHMM(**params), ParamsGaussianHMM(**props)
File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/hidden_markov_model/models/gaussian_hmm.py:83, inGaussianHMMEmissions.initialize(self, key, method, emission_means, emission_covariances, emissions)
[81](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/hidden_markov_model/models/gaussian_hmm.py:81) elifmethod.lower() =="prior":
[82](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/hidden_markov_model/models/gaussian_hmm.py:82) this_key, key=jr.split(key)
---> [83](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/hidden_markov_model/models/gaussian_hmm.py:83) prior=NormalInverseWishart(self.emission_prior_mean, self.emission_prior_conc,
[84](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/hidden_markov_model/models/gaussian_hmm.py:84) self.emission_prior_df, self.emission_prior_scale)
[85](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/hidden_markov_model/models/gaussian_hmm.py:85) (_emission_covs, _emission_means) =prior.sample(seed=this_key, sample_shape=(self.num_states,))
[87](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/hidden_markov_model/models/gaussian_hmm.py:87) else:
File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/decorator.py:232, indecorate.<locals>.fun(*args, **kw)
[230](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/decorator.py:230) ifnotkwsyntax:
[231](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/decorator.py:231) args, kw=fix(args, kw, sig)
--> [232](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/decorator.py:232) returncaller(func, *(extras+args), **kw)
File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:342, in_DistributionMeta.__new__.<locals>.wrapped_init(***failedresolvingarguments***)
[339](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:339) # Note: if we ever want to have things set in `self` before `__init__` is
[340](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:340) # called, here is the place to do it.
[341](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:341) self_._parameters=None--> [342](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:342) default_init(self_, *args, **kwargs)
[343](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:343) # Note: if we ever want to override things set in `self` by subclass
[344](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:344) # `__init__`, here is the place to do it.
[345](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:345) ifself_._parametersisNone:
[346](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:346) # We prefer subclasses will set `parameters = dict(locals())` because
[347](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:347) # this has nearly zero overhead. However, failing to do this, we will
[348](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:348) # resolve the input arguments dynamically and only when needed.File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:133, inNormalInverseWishart.__init__(self, loc, mean_concentration, df, scale)
[129](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:129) self._df=df
[130](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:130) self._scale=scale
[132](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:132) super(NormalInverseWishart, self).__init__([
--> [133](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:133) InverseWishart(df, scale),
[134](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:134) lambdaSigma: tfd.MultivariateNormalFullCovariance(loc, Sigma/mean_concentration)
[135](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:135) ])
[137](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:137) self._parameters=dict(loc=loc, mean_concentration=mean_concentration, df=df, scale=scale)
File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/decorator.py:232, indecorate.<locals>.fun(*args, **kw)
[230](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/decorator.py:230) ifnotkwsyntax:
[231](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/decorator.py:231) args, kw=fix(args, kw, sig)
--> [232](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/decorator.py:232) returncaller(func, *(extras+args), **kw)
File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:342, in_DistributionMeta.__new__.<locals>.wrapped_init(***failedresolvingarguments***)
[339](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:339) # Note: if we ever want to have things set in `self` before `__init__` is
[340](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:340) # called, here is the place to do it.
[341](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:341) self_._parameters=None--> [342](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:342) default_init(self_, *args, **kwargs)
[343](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:343) # Note: if we ever want to override things set in `self` by subclass
[344](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:344) # `__init__`, here is the place to do it.
[345](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:345) ifself_._parametersisNone:
[346](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:346) # We prefer subclasses will set `parameters = dict(locals())` because
[347](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:347) # this has nearly zero overhead. However, failing to do this, we will
[348](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:348) # resolve the input arguments dynamically and only when needed.File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:51, inInverseWishart.__init__(self, df, scale)
[48](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:48) cho_scale=jnp.linalg.cholesky(scale)
[49](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:49) inv_scale_tril=solve_triangular(cho_scale, eye, lower=True)
---> [51](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:51) super().__init__(
[52](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:52) tfd.WishartTriL(df, scale_tril=inv_scale_tril),
[53](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:53) tfb.Chain([tfb.CholeskyOuterProduct(),
[54](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:54) tfb.CholeskyToInvCholesky(),
[55](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:55) tfb.Invert(tfb.CholeskyOuterProduct())]))
[57](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/dynamax/utils/distributions.py:57) self._parameters=dict(df=df, scale=scale)
File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/decorator.py:232, indecorate.<locals>.fun(*args, **kw)
[230](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/decorator.py:230) ifnotkwsyntax:
[231](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/decorator.py:231) args, kw=fix(args, kw, sig)
--> [232](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/decorator.py:232) returncaller(func, *(extras+args), **kw)
File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:342, in_DistributionMeta.__new__.<locals>.wrapped_init(***failedresolvingarguments***)
[339](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:339) # Note: if we ever want to have things set in `self` before `__init__` is
[340](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:340) # called, here is the place to do it.
[341](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:341) self_._parameters=None--> [342](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:342) default_init(self_, *args, **kwargs)
[343](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:343) # Note: if we ever want to override things set in `self` by subclass
[344](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:344) # `__init__`, here is the place to do it.
[345](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:345) ifself_._parametersisNone:
[346](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:346) # We prefer subclasses will set `parameters = dict(locals())` because
[347](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:347) # this has nearly zero overhead. However, failing to do this, we will
[348](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/distribution.py:348) # resolve the input arguments dynamically and only when needed.File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/transformed_distribution.py:244, in_TransformedDistribution.__init__(self, distribution, bijector, kwargs_split_fn, validate_args, parameters, name)
[238](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/transformed_distribution.py:238) self._zero=tf.constant(0, dtype=tf.int32, name='zero')
[240](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/transformed_distribution.py:240) # We don't just want to check isinstance(JointDistribution) because
[241](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/transformed_distribution.py:241) # TransformedDistributions with multipart bijectors are effectively
[242](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/transformed_distribution.py:242) # joint but don't inherit from JD. The 'duck-type' test is that
[243](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/transformed_distribution.py:243) # JDs have a structured dtype.--> [244](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/transformed_distribution.py:244) dtype=self.bijector.forward_dtype(self.distribution.dtype)
[245](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/transformed_distribution.py:245) self._is_joint=tf.nest.is_nested(dtype)
[247](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/transformed_distribution.py:247) super(_TransformedDistribution, self).__init__(
[248](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/transformed_distribution.py:248) dtype=dtype,
[249](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/transformed_distribution.py:249) reparameterization_type=self._distribution.reparameterization_type,
(...)
[252](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/transformed_distribution.py:252) parameters=parameters,
[253](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/distributions/transformed_distribution.py:253) name=name)
File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1705, inBijector.forward_dtype(self, dtype, name, **kwargs)
[1701](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1701) input_dtype=nest_util.broadcast_structure(
[1702](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1702) self.forward_min_event_ndims, self.dtype)
[1703](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1703) else:
[1704](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1704) # Make sure inputs are compatible with statically-known dtype.-> [1705](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1705) input_dtype=nest.map_structure_up_to(
[1706](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1706) self.forward_min_event_ndims,
[1707](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1707) lambdax: dtype_util.convert_to_dtype(x, dtype=self.dtype),
[1708](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1708) nest_util.coerce_structure(self.forward_min_event_ndims, dtype),
[1709](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1709) check_types=False)
[1711](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1711) output_dtype=self._forward_dtype(input_dtype, **kwargs)
[1712](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1712) try:
[1713](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1713) # kwargs may alter dtypes themselves, but we currently require
[1714](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1714) # structure to be statically known.File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:324, inmap_structure_up_to(shallow_structure, func, *structures, **kwargs)
[323](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:323) defmap_structure_up_to(shallow_structure, func, *structures, **kwargs):
--> [324](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:324) returnmap_structure_with_tuple_paths_up_to(
[325](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:325) shallow_structure,
[326](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:326) lambda_, *args: func(*args), # Discards path.
[327](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:327) *structures,
[328](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:328) **kwargs)
File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:353, inmap_structure_with_tuple_paths_up_to(shallow_structure, func, expand_composites, *structures, **kwargs)
[350](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:350) forinput_treeinstructures:
[351](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:351) assert_shallow_structure(
[352](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:352) shallow_structure, input_tree, check_types=check_types)
--> [353](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:353) returndm_tree.map_structure_with_path_up_to(
[354](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:354) shallow_structure, func, *structures, **kwargs)
File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tree/__init__.py:771, inmap_structure_with_path_up_to(***failedresolvingarguments***)
[769](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tree/__init__.py:769) results= []
[770](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tree/__init__.py:770) forpath_and_valuesin_multiyield_flat_up_to(shallow_structure, *structures):
--> [771](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tree/__init__.py:771) results.append(func(*path_and_values))
[772](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tree/__init__.py:772) returnunflatten_as(shallow_structure, results)
File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:326, inmap_structure_up_to.<locals>.<lambda>(_, *args)
[323](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:323) defmap_structure_up_to(shallow_structure, func, *structures, **kwargs):
[324](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:324) returnmap_structure_with_tuple_paths_up_to(
[325](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:325) shallow_structure,
--> [326](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:326) lambda_, *args: func(*args), # Discards path.
[327](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:327) *structures,
[328](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/python/internal/backend/jax/nest.py:328) **kwargs)
File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1707, inBijector.forward_dtype.<locals>.<lambda>(x)
[1701](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1701) input_dtype=nest_util.broadcast_structure(
[1702](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1702) self.forward_min_event_ndims, self.dtype)
[1703](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1703) else:
[1704](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1704) # Make sure inputs are compatible with statically-known dtype.
[1705](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1705) input_dtype=nest.map_structure_up_to(
[1706](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1706) self.forward_min_event_ndims,
-> [1707](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1707) lambdax: dtype_util.convert_to_dtype(x, dtype=self.dtype),
[1708](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1708) nest_util.coerce_structure(self.forward_min_event_ndims, dtype),
[1709](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1709) check_types=False)
[1711](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1711) output_dtype=self._forward_dtype(input_dtype, **kwargs)
[1712](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1712) try:
[1713](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1713) # kwargs may alter dtypes themselves, but we currently require
[1714](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/bijectors/bijector.py:1714) # structure to be statically known.File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/internal/dtype_util.py:247, inconvert_to_dtype(tensor_or_dtype, dtype, dtype_hint)
[245](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/internal/dtype_util.py:245) elifisinstance(tensor_or_dtype, np.ndarray):
[246](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/internal/dtype_util.py:246) dt=base_dtype(dtypeordtype_hintortensor_or_dtype.dtype)
--> [247](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/internal/dtype_util.py:247) elifnp.issctype(tensor_or_dtype):
[248](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/internal/dtype_util.py:248) dt=base_dtype(dtypeordtype_hintortensor_or_dtype)
[249](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/internal/dtype_util.py:249) else:
[250](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/internal/dtype_util.py:250) # If this is a Python object, call `convert_to_tensor` and grab the dtype.
[251](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/internal/dtype_util.py:251) # Note that this will add ops in graph-mode; we may want to consider
[252](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/tensorflow_probability/substrates/jax/internal/dtype_util.py:252) # other ways to handle this case.File~/miniforge3/envs/dynamax/lib/python3.12/site-packages/numpy/__init__.py:400, in__getattr__(attr)
[397](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/numpy/__init__.py:397) raiseAttributeError(__former_attrs__[attr], name=None)
[399](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/numpy/__init__.py:399) ifattrin__expired_attributes__:
--> [400](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/numpy/__init__.py:400) raiseAttributeError(
[401](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/numpy/__init__.py:401) f"`np.{attr}` was removed in the NumPy 2.0 release. "
[402](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/numpy/__init__.py:402) f"{__expired_attributes__[attr]}",
[403](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/numpy/__init__.py:403) name=None
[404](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/numpy/__init__.py:404) )
[406](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/numpy/__init__.py:406) ifattr=="chararray":
[407](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/numpy/__init__.py:407) warnings.warn(
[408](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/numpy/__init__.py:408) "`np.chararray` is deprecated and will be removed from "
[409](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/numpy/__init__.py:409) "the main namespace in the future. Use an array with a string "
[410](https://file+.vscode-resource.vscode-cdn.net/home/gdalle/Work/Review/~/miniforge3/envs/dynamax/lib/python3.12/site-packages/numpy/__init__.py:410) "or bytes dtype instead.", DeprecationWarning, stacklevel=2)
AttributeError: `np.issctype`wasremovedintheNumPy2.0release. Use`issubclass(rep, np.generic)`instead.
When I manually ensure that numpy 1.26.4 is used instead, I get an error even earlier, right when I try to import dynamax
Hi and congrats on the package!
I'm one of the reviewers for the JOSS paper you submitted, so here I'll list my questions and concerns about the code itself. This issue will be updated as my reading progresses so maybe don't start answering right away.
Warning
I am not a Python developer, my main language is Julia, so I won't be able to give much advice beyond what I observed when trying out the examples. In addition, I don't know the best practices in terms of package and version management, I just use mamba and then pip inside the mamba environment.
Design
Execution
Tests
I followed the testing workflow on the home page of the documentation and it yielded one failure.
First tutorial
When I try to run the tutorial notebook after naive installation, it fails to generate sample data due to a Numpy 2.0 breaking change. I'm not sure why pip allowed me to install Numpy 2.0 as a dependency, since it doesn't seem to be supported yet (#366).
When I manually ensure that numpy 1.26.4 is used instead, I get an error even earlier, right when I try to import dynamax
Related issues:
The text was updated successfully, but these errors were encountered: