sintel-dev / Orion

A machine learning library for detecting anomalies in signals.
https://sintel.dev/Orion/
MIT License
1.04k stars 162 forks source link

Use own inputs to reproduce the turtial / shape error #175

Closed sojunen142 closed 3 years ago

sojunen142 commented 3 years ago

Description

Hi, when I use my input which size is (1, 1096, 1) to the example of this document https://signals-dev.github.io/Orion/user_guides/primitives_pipelines/primitives/TadGAN.html , I got the error :

Traceback (most recent call last): File "c:/Users/Weiiiii/Desktop/GAN_tmp/g0206.py", line 43, in <module> primitive.fit() File "C:\Users\Weiiiii\.conda\envs\GANenv\lib\site-packages\mlblocks\mlblock.py", line 302, in fit getattr(self.instance, self.fit_method)(**fit_kwargs) File "C:\Users\Weiiiii\.conda\envs\GANenv\lib\site-packages\orion\primitives\tadgan.py", line 221, in fit self._build_tadgan(**kwargs) File "C:\Users\Weiiiii\.conda\envs\GANenv\lib\site-packages\orion\primitives\tadgan.py", line 139, in _build_tadgan interpolated_x = RandomWeightedAverage()([x, x_]) File "C:\Users\Weiiiii\.conda\envs\GANenv\lib\site-packages\keras\engine\base_layer.py", line 463, in __call__ self.build(unpack_singleton(input_shapes)) File "C:\Users\Weiiiii\.conda\envs\GANenv\lib\site-packages\keras\layers\merge.py", line 91, in build shape) File "C:\Users\Weiiiii\.conda\envs\GANenv\lib\site-packages\keras\layers\merge.py", line 61, in _compute_elemwise_op_output_shape str(shape1) + ' ' + str(shape2)) ValueError: Operands could not be broadcast together with shapes (1096, 1) (100, 1) I also meet the shape error in this toturial (https://analyticsindiamag.com/hands-on-guide-to-tadgan-with-python-codes/ ) when I'm trying to change the 'window_size' in the rolling_window_sequences function.

sarahmish commented 3 years ago

Hi @sojunen142

To use the TadGAN model, we require that the window size to be set to window_size=100 for now. Reason being, the intermediate layers expect that the units to be 100.

You can read more about the TadGAN setup in our tutorial here.

salman087 commented 3 years ago

Can we choose window_size differently other than 100 for TadGan and other pipelines?