-
Notifications
You must be signed in to change notification settings - Fork 118
Unexpected Results Depending on DisCoPy Installation Timing #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@SiyoonKIM Hi and thanks for reporting this. Can you please try the same with |
@dimkart Hi, thank you for your response. When running: pip install "discopy>=1.1.0" DisCoPy 1.2.0 gets installed. To verify, I first uninstalled DisCoPy and then ran: pip uninstall discopy
pip install "discopy>=1.1.7" Yet, DisCoPy 1.2.0 was still installed. After rerunning the tutorial, the issue persists—the accuracy drop still occurs. Would you recommend explicitly installing a specific version (e.g., 1.1.7 or 1.1.8) for further testing? |
So in both cases you mention (pre-installed and dynamically installed), do you end up with the same version of DisCoCy or these are different? Can you check @SiyoonKIM |
In general have in mind that dynamic installation is much safer since dependencies are taken care automatically (can be upgraded or downgraded as required) while a pre-installation can't do that. In any case we'll have a closer look and come back to you. I would suggest you to do a freeze for both cases after the installation to check differences in the packages versions. |
Hi @SiyoonKIM. I tried the steps you outlined above but couldn't replicate the issue - in both cases, I got the lower accuracy result. I've verified that installing What happens when you install |
Thank you for your responses. I ran some tests in a venv environment using Visual Studio Code and obtained the following results:
I hope this additional information helps with the investigation. Please let me know if you need any further details or clarifications. requirements0.txt |
Issue Description
When following the PennyLane blog tutorial, I observed that the results differ based on when DisCoPy is installed.
"Initializing the model"
step.This suggests that pre-installing both LAMBEQ and DisCoPy might introduce unexpected interactions, affecting some processes.
This issue affects the reproducibility of quantum NLP models trained with LAMBEQ and PennyLane. If the model's accuracy depends on the installation timing of DisCoPy, it becomes difficult to ensure consistent training results.
Environment
Steps to Reproduce
Case 1: Installing DisCoPy During Execution
lambeq
installed:pip install "discopy>=1.1.0"
Case 2: Pre-installing DisCoPy
pip3 install torch torchvision torchaudio pip install pennylane pip install lambeq pip install "discopy>=1.1.0"
Expected Behavior
The results should be consistent regardless of whether DisCoPy is pre-installed or installed dynamically.
Reference Notebook
The following Jupyter Notebook contains the code from the PennyLane blog tutorial, provided here for reference.
qnlp_pennylane_blog.ipynb.zip
The text was updated successfully, but these errors were encountered: