-
Notifications
You must be signed in to change notification settings - Fork 33
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
Healthcare and life science use case: retrosynthetic planning using reinforcement learning #121
Healthcare and life science use case: retrosynthetic planning using reinforcement learning #121
Conversation
@AoyuQC, quick clarification - is this PR ready for review? If yes, would you please remove "WIP" from the title to indicate this? If no, would you please convert the PR to draft until it is ready? Thank you! |
Hi, I will convert it to draft |
data prepare code
Confirmed with Aoyu (the author). The PR is ready for review. Could someone please take a look? Thanks! |
@rmshaffer , please change it from draft to ready to review status. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't reviewed the content of the algorithm or notebook, but I left a few initial comments on the code structure and formatting. To enable the CI to pass, please ensure that you can run the successfully following commands locally:
black .
andflake8
➡️ checks code formatting; please fix any failures reportedtox -e unit-tests
➡️ runs unit tests; please ensure that your new test runs successfully in this method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this file be named requirements.txt
?
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). You | ||
# may not use this file except in compliance with the License. A copy of | ||
# the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0/ | ||
# | ||
# or in the "license" file accompanying this file. This file is | ||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF | ||
# ANY KIND, either express or implied. See the License for the specific | ||
# language governing permissions and limitations under the License. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If your goal is to use this copyright/license for the PR, can you please ensure this is at the top of every new .py
file you've added?
# os.system(f"aws s3 cp {save_path} s3://{s3}/data/{save_name}") | ||
# AWS_REGION = "us-west-1" | ||
# S3_BUCKET_NAME = "amazon-braket-us-west-1-493904798517" | ||
# s3_client = boto3.client("s3", region_name=AWS_REGION) | ||
# s3_client.upload_file(save_path, S3_BUCKET_NAME, f'data/{save_name}') | ||
# job_name = os.environ["AMZN_BRAKET_JOB_NAME"] | ||
# save_job_checkpoint( | ||
# checkpoint_data={"data": f"data for checkpoint from {job_name}"}, | ||
# checkpoint_file_suffix="checkpoint-1", | ||
# ) | ||
# if retro_rl_agent.name.split('_')[1] == 'aspen-m2': | ||
# AWS_REGION = "us-west-1" | ||
# S3_BUCKET_NAME = "amazon-braket-us-west-1-493904798517" | ||
# s3_client = boto3.client("s3", region_name=AWS_REGION) | ||
# s3_client.upload_file(save_path, S3_BUCKET_NAME, f'data/{save_name}') | ||
# else: | ||
# AWS_REGION = "us-west-1" | ||
# S3_BUCKET_NAME = "amazon-braket-us-west-1-493904798517" | ||
# s3_client = boto3.client("s3", region_name=AWS_REGION) | ||
# s3_client.upload_file(save_path, S3_BUCKET_NAME, f'data/{save_name}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a general comment that applies to the whole PR - it's best practice to avoid merging code that is commented-out. (For a few reasons: it's not testable; it will likely break in the future, even if it works now; and it's not clear to a reader why the code is there.) For each commented block of code, is there a good reason to keep the code? If so, is there an alternative to having it commented out (for example, put it behind a flag that the user can optionally enable)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind doing a quick spell-check on the notebook content?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if you would like to run automatic Python code formatting on this notebook, you can use black
for this:
pip install "black[jupyter]"
black ./notebooks/industry_applications/healthcare-and-life-sciences/Retrosynthetic_Planning/Retrosynthetic_Planning_Quantum_Reinforcement_Learning.ipynb
Hi @AoyuQC , thanks for the PR. I have a few comments from the scientific perspective. However, I have a few concerns about the results obtained in the notebook and their interpretation:
|
Hello AoyuQC, The algorithm you are proposing to add has many external dependencies, and it explicitly relies on the user running the terminal instructions from the notebook. It's clear that the nature of this use case necessitates these dependencies, but as maintainers of the Braket Algorithm library, we wish to make the dependencies minimal and, more importantly, explicit. After reviewing your PR, we think, in its current form, it is better suited to be developed in a separate repo; and instead, we'd love to feature it in the Braket Algorithm library "Community repos" section, which we recently added. I will close this PR for now, but feel free to continue to work on it here and reopen. |
Hi @peterkomar-aws , Thank you for the update. I am working on it. Best, Aoyu |
Description of changes:
Refactor the code in aws solution (https://aws.amazon.com/solutions/implementations/quantum-computing-exploration-for-drug-discovery/) and contribute to braket algorithm library. This is the first use case, the use of quantum circuit in reinforcement learning to solve the problem of retrosynthetic planning
Testing done:
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.