diku-dk / bfast

GPU Implementation for BFAST
GNU General Public License v3.0
37 stars 17 forks source link

Results python vs opencl #6

Closed Carolina710 closed 3 years ago

Carolina710 commented 4 years ago

Good morning, it is possible to obtain different breaks and means values for the same data (and dates) inputs, when I run the algorithm in python and openCL?

The input data is a simple one with 124 series 17x17. In this case, I executed the algorithm in python, and next, I executed in openCL and obtained different values for breaks and means. I used in both cases the default values for k = 3, freq = 365, trend = False, hfrac = 0.25, level = 0.05 and I just changed the backend value. I must say that for some start_monitor dates the results for the breaks are equal (which is good), but not always. It is possible to obtain different breaks and means values when I change only the backend value, or I'm doing something wrong?

Thank you all, in advance! Best regards

mortvest commented 3 years ago

Yes, it is currently possible. We are working on fixing the discrepancies between the two backends. Could you provide us the dataset that you used to get the error? A single time series would suffice. Thank you

Carolina710 commented 3 years ago

Hello Dmitry,

Thank you for your response.

I share data "subset_1": https://drive.google.com/drive/folders/1MkvA-MSvZCu_8WHkQ4p3R8Z0Qv_Vq-JC?usp=sharing And data "Tile_1": https://drive.google.com/drive/folders/15DK5T9hZUaaIBNsfzR3tTp5pFb9XCWt5?usp=sharing

The data images are named with the dates, and you can simply collect in this way:

image

Those are the parameters that I used (I tried also freq=365). I didn't need to crop the data or dates since I used all the subset (124 Images). Nan_value = 0.

I'm obtaining results for the bfast main function not detailed. The one that just returns breaks and means.

Another thing that I would like to inform you about

For the "Tile_1" data, I did the same test above, and in this case, I detected 2 errors in the python version.

The first one is in file "base.py" here:

image

In line 200 I had to add that line of code, initializing the value for "first_break", because if you don't, and return, the algorithm assumes there is no value for the first_break parameter.

Second, which I don't have a solution:

After updating the first solution, an error occurs while processing row 120, in Python version. This error does not always happen, in this case, it happens when I use start_monitor = datetime(2018, 6, 18), for example.

image

But running in OpenCL I can obtain results.

Last questions:

I read this article https://arxiv.org/pdf/1807.01751.pdf

But I don't have entirely sure what are the values returned in the means array. Corresponds to the magnitude? My means values are always negative, and in python version is like Max:0 Min:-3.... and OpenCL Max:0 Min:-44....

If you prefer I can open other "issues" for all my other questions.

Obrigada/Best regards, Carolina Oliveira

mortvest commented 3 years ago

Hello Carolina,

Thank you for the information.

  1. Could you please create a gist with the code that you have used?

  2. For the "first_break" issue, I am familiar with it and the solution would be added to the develop branch soon

  3. What did you mean by "first solution"? Could you also create a gist with the code?

  4. For the magnitude issue, there is a couple of problems and I am also working on this.

Could you split your question into multiple issues? That would make it easier for us to keep track of all problems.

Thanks, Dmitry

Carolina710 commented 3 years ago

Hello,

1. Could you please create a gist with the code that you have used?

Here is the gist (more complete): https://gist.github.com/Carolina710/330b473478dd59188edaaa6a3fd76bb6

2. For the "first_break" issue, I am familiar with it and the solution would be added to the develop branch soon

Thank you!

3. What did you mean by "first solution"? Could you also create a gist with the code?

I mean after I add the line _self.firstbreak = -1 I can run the algorithm in Python for Tile_1 and detect the 2nd error that I mention (in Fig 3).

4. For the magnitude issue, there is a couple of problems and I am also working on this.

Thank you!

I will split these issues later as soon as possible :)

mortvest commented 3 years ago

Should be fixed in develop