gretelai / gretel-synthetics

Synthetic data generators for structured and unstructured text, featuring differentially private learning.
https://gretel.ai/platform/synthetics
Other
579 stars 87 forks source link

timeseries_dgan.ipynb example - error from train_numpy #125

Closed Rane90 closed 2 years ago

Rane90 commented 2 years ago

Hellow,

Trying to run the example in the notebook this part results in an error

model.train_numpy(
    features,
    feature_types=[OutputType.CONTINUOUS] * features.shape[2],
)

_File "C:\Users\Ran\anaconda3\envs\eeg_gan_v6\lib\site-packages\gretel_synthetics\timeseries_dgan\dgan.py", line 186, in trainnumpy if attributes.shape[0] != features.shape[0]: AttributeError: 'NoneType' object has no attribute 'shape'

I managed to make it run by simply declaring and passing attributes:

attributes = np.zeros(features.shape[0], 1)
model.train_numpy(
    features,
    feature_types=[OutputType.CONTINUOUS] * features.shape[2],
    attributes=attributes
)

So:

  1. Either this argument isn't optional or I have made a mistake :)
  2. Can you please elaborate more on what exactly attributes are? are they metadata/labels? I'm not entirely sure about the documentation.

Thank you

johntmyers commented 2 years ago

Hi @Rane90 - this was a bug and is currently fixed on the master branch. I expect we will probably tag a new release this week. In the interim, you can always install the latest from master and see if this works for you without needing the attributes kwarg.

johntmyers commented 2 years ago

Hi @Rane90 just wanted to follow up that we have published the fix for this error you ran into. If you install the latest package with pip install -U gretel-synthetics and have at least version 0.18.1 then you should not need to provide the attributes param explicitly. Let us know if you have any other questions!