Open fabienmorgan opened 1 month ago
Dear colleagues, thank you very much for your interest in our work. We have done a test to solve your problem, and there seems to be no problem in our test.
os.environ = 3 2024-05-23 17:21:14.511827: ... $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ os.environ = 3 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ os.environ = 3 Function: (x+((x)^2)) R2: 1.0 Relative error: 5.303451293530877e-17
You can also specify the expression you want to test in predict.py and then run the code with python predict.py. I wish you a happy life.
os.environ = 3 2024-05-23 17:28:51.094565: ... $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ os.environ = 3 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ os.environ = 3 Function: (x+((x)^2)) R2: 1.0 Relative error: 3.016847939590277e-17
Looking further in the code, it seems that the predict function doesn't take an equation as an argument and just predicts the equation sin(x) + y
. There is no indication of using any of the arguments that were put in and the line function = 'sin(x) + y'
(Line 18) indicate that it takes this hardcoded equation. This would also answer the question of why it returned the following output with an R2 of 1.0 for this command python -m MMSR predict --model model 'x**2 + x':
Function: (y+sin(x))
R2: 1.0
Relative error: 0.0
Can you confirm that this is the case or if it is not the case to tell me what this hardcoded equation does in the predict.py?
Setup: I have cloned your project and also cloned the provided weights. I created a new environment with
Python 3.8.10
and installed like the README suggestspip install -r requirements.txt
. I couldn't build the wheel ofpycocotools
so I commented it out of the requirements. The code ran perfectly fine.Issue: After running the suggested example,
python -m MMSR predict --model /path/to/MMSR-model 'x**2 + x'
three times I got a wrong R2 score for at least two runs. The whole output is at the end of the description, but the relevant part of the free runs can be seen right below:python -m MMSR predict --model /model 'x*
Output:python -m MMSR predict --model model 'x**2 + x'
Output:python -m MMSR predict --model model 'x**2 + x'
OutputNow multiple questions came up. Firstly, it seems to be that the R2 score gets calculated wrongly. There is no case where the R2 score of two different equations give 1.0. Even in cases where the equation is mathematically the same but the order of the operators changes, it can happen that the equation doesn't return a R2 score of 1.0. Another question that rises from this output is what is y in the equation? Does the predicted equation
(y+sin(x))
meany=sin(x)
, did the prediction invent another variable, is y a placeholder for a constant or does y have an other meaning? The last question is about the relative error. I couldn't find the explanation to this value in the repository, so my question is, is this the mean relative error over all sampled points?