Open hiroara opened 1 year ago
As far as I investigated, both are about the name
argument.
For the multiple values for keyword argument 'name'
issue, in the _make_state_space_model
method,
tfp.sts.Autoregressive
passes name=self.name
to a state space model class
tfp.sts.LocalLevel
doesn't do it
For the tfp.sts.Autoregressive
case, if the name
key is included in linear_gaussian_ssm_kwargs
, the error should occur.
Also, for the ValueError: Field names must be valid identifiers
case,
tfp.sts.AutoregressiveIntegratedMovingAverage
passes name=self.name
to a state space model
parameters
in tfp.sts.AutoregressiveMovingAverageStateSpaceModel
tfd.JointDistribution
I wonder how these issues can be resolved. For example, classes under tfp.sts
have /
suffix in its name:
>>> tfp.sts.AutoregressiveIntegratedMovingAverage(0, 0, 0).name
'ARIMA/'
>>> tfp.sts.AutoregressiveIntegratedMovingAverage(0, 0, 0, name="custom").name
'custom/'
>>> tfp.sts.LocalLevel().name
'LocalLevel/'
>>> tfp.sts.LocalLevel(name="ll").name
'll/'
Also, when making an SSM from tfp.sts.AutoregressiveIntegratedMovingAverage
, all the nested models look to have the same name.
https://github.com/tensorflow/probability/blob/c0908aba1ac6cbc42ab95e4d43434ab238b0687d/tensorflow_probability/python/sts/components/autoregressive_integrated_moving_average.py#L378-L391
I suspect there is something around these places, but I don't have enough knowledge about the past design decision to consider the right solution. Does anyone have ideas about these points?
Hi, thank you for providing a great product. I'm trying to build a model with
tfp.sts
package but I'm facing issues around thename
argument.TypeError: tensorflow_probability.python.sts.components.autoregressive.AutoregressiveStateSpaceModel() got multiple values for keyword argument 'name'
Script
Error
ValueError: Field names must be valid identifiers: arima/
Script
Error
Minimal reproducible example
I created a project to reproduce these errors. After checking out, please install the dependencies:
poetry install --without tf --with tf_apple_silicon
poetry install
Then, you can reproduce the above errors on each branch:
TypeError: tensorflow_probability.python.sts.components.autoregressive.AutoregressiveStateSpaceModel() got multiple values for keyword argument 'name'
poetry run python example.py
=> Reproduce the above error:tfp.sts.Autoregressive
causes the errorpoetry run python example.py successful
=> Normal case:tfp.sts.LocalLevel
works without any errorValueError: Field names must be valid identifiers: arima/
poetry run python example.py
=> Reproduce the above error: The combination oftfp.sts.AutoregressiveIntegratedMovingAverage
andtfd.JointDistributionCoroutine
causes the errorpoetry run python example.py locallevel
=> Normal case:tf.sts.LocalLevel
&tfd.JointDistributionCoroutine
works without any errorpoetry run python example.py sequential
=> Normal case:tf.sts.AutoregressiveIntegratedMovingAverage
&tfd.JointDistributionSequential
works without any errorpoetry run python example.py named
=> Normal case:tf.sts.AutoregressiveIntegratedMovingAverage
&tfd.JointDistributionSequential
works without any errorDoes someone have any thoughts on how to resolve these issues?