Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 28 additions & 46 deletions tutorials/openmm-torch-nnpops.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"base_uri": "https://localhost:8080/"
},
"id": "EcB2lc1s3ZXG",
"outputId": "1ce0bad8-a050-48d5-c18a-9e49fbeb11c2"
"outputId": "ca3b9161-9de2-4fc3-a497-235011951876"
},
"outputs": [
{
Expand All @@ -50,15 +50,15 @@
"📦 Installing...\n",
"📌 Adjusting configuration...\n",
"🩹 Patching environment...\n",
"⏲ Done in 0:00:34\n",
"⏲ Done in 0:00:18\n",
"🔁 Restarting kernel...\n"
]
}
],
"source": [
"!pip install -q condacolab\n",
"import condacolab\n",
"condacolab.install_miniconda()"
"condacolab.install_mambaforge()"
]
},
{
Expand All @@ -82,11 +82,17 @@
},
"outputs": [],
"source": [
"# NOTE: PyTorch pinned because https://github.com/conda-forge/openmm-torch-feedstock/issues/20\n",
"!mamba install -q -c conda-forge \\\n",
" openmm-torch nnpops torchani openmmtools \\\n",
" pytorch=1.11 \\\n",
" &> /dev/null # Comment this line to see a log\""
"# Note: at the moment only the beta releases work correctly.\n",
"!mamba install -q \\\n",
" -c conda-forge/label/openmm_rc \\\n",
" -c conda-forge/label/openmm-torch_rc \\\n",
" -c conda-forge \\\n",
" openmm==8.0.0beta \\\n",
" openmm-torch==1.0beta \\\n",
" nnpops==0.2 \\\n",
" torchani==2.2.2 \\\n",
" openmmtools \\\n",
" &> /dev/null # Comment this line to see a log"
Comment on lines +85 to +95
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be good to go with a some changes here, right?
I guess removing the channels and the betas should do the trick, also nnpops to 0.5?

]
},
{
Expand All @@ -110,15 +116,7 @@
"id": "zNng_d4mGKve",
"outputId": "218e0775-766b-4597-9d48-96e3d65df374"
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Warning: importing 'simtk.openmm' is deprecated. Import 'openmm' instead.\n"
]
}
],
"outputs": [],
"source": [
"import openmmtools\n",
"\n",
Expand Down Expand Up @@ -159,29 +157,13 @@
"outputId": "4181fcb6-db72-47e7-edb5-2a4bb0252de7"
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/local/lib/python3.7/site-packages/torchani/__init__.py:55: UserWarning: Dependency not satisfied, torchani.ase will not be available\n",
" warnings.warn(\"Dependency not satisfied, torchani.ase will not be available\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"/usr/local/lib/python3.7/site-packages/torchani/resources/\n",
"Downloading ANI model parameters ...\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/local/lib/python3.7/site-packages/torch/functional.py:1069: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /home/conda/feedstock_root/build_artifacts/pytorch-recipe_1640851336451/work/aten/src/ATen/native/TensorShape.cpp:2156.)\n",
" return _VF.cartesian_prod(tensors) # type: ignore[attr-defined]\n"
]
}
],
"source": [
Expand Down Expand Up @@ -322,7 +304,7 @@
"# Create a simulation and set the initial positions and velocities\n",
"simulation = Simulation(ala2.topology, ala2.system, integrator)\n",
"simulation.context.setPositions(ala2.positions)\n",
"# simulation.context.setVelocitiesToTemperature(temperature) # This does not work (https://github.com/openmm/openmm-torch/issues/61)\n",
"simulation.context.setVelocitiesToTemperature(temperature)\n",
"\n",
"# Configure a reporter to print to the console every 0.1 ps (100 steps)\n",
"reporter = StateDataReporter(file=sys.stdout, reportInterval=100, step=True, time=True, potentialEnergy=True, temperature=True)\n",
Expand All @@ -346,7 +328,7 @@
"base_uri": "https://localhost:8080/"
},
"id": "JN9v2rz3KbTz",
"outputId": "15367844-1caa-40c1-bb5b-f94f7b51eb1b"
"outputId": "7ef59ac1-520a-4076-a1c5-fc2ec7df5136"
},
"outputs": [
{
Expand Down Expand Up @@ -390,24 +372,24 @@
"base_uri": "https://localhost:8080/"
},
"id": "da0v6qJHBtUb",
"outputId": "e477991e-93b0-4e72-de4f-d7a8b05052de"
"outputId": "bc7426d5-42dc-455a-d20d-733e51ea644f"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"#\"Step\",\"Time (ps)\",\"Potential Energy (kJ/mole)\",\"Temperature (K)\"\n",
"100,0.10000000000000007,-1301527.998092823,62.28599411217165\n",
"200,0.20000000000000015,-1301519.2141580286,68.6151680329106\n",
"300,0.3000000000000002,-1301513.905558333,103.32518127627559\n",
"400,0.4000000000000003,-1301517.7584694924,118.20611762387\n",
"500,0.5000000000000003,-1301514.9794064017,165.4939713543869\n",
"600,0.6000000000000004,-1301507.6431399288,148.54034468306415\n",
"700,0.7000000000000005,-1301511.109281123,157.43310789810866\n",
"800,0.8000000000000006,-1301498.8263809385,157.8375886414082\n",
"900,0.9000000000000007,-1301511.3014532926,199.2036328097003\n",
"1000,1.0000000000000007,-1301485.2554342675,148.26160451888617\n"
"100,0.10000000000000007,-1301523.916390367,92.40824830382874\n",
"200,0.20000000000000015,-1301518.7990238892,119.2893445291452\n",
"300,0.3000000000000002,-1301513.695350461,152.9633322198495\n",
"400,0.4000000000000003,-1301508.793747321,161.74950978774066\n",
"500,0.5000000000000003,-1301504.6699876415,164.00853843792856\n",
"600,0.6000000000000004,-1301498.9500878605,159.56241762805863\n",
"700,0.7000000000000005,-1301508.518243164,197.16748430772566\n",
"800,0.8000000000000006,-1301501.4794679733,217.2560582437653\n",
"900,0.9000000000000007,-1301479.1362451615,189.695421119118\n",
"1000,1.0000000000000007,-1301481.766797349,256.3789993541881\n"
]
}
],
Expand Down