Skip to content

Commit

Permalink
wip diffusion deep dive
Browse files Browse the repository at this point in the history
  • Loading branch information
miketynes committed Nov 8, 2024
1 parent eb00a9a commit 584a16b
Showing 1 changed file with 201 additions and 0 deletions.
201 changes: 201 additions & 0 deletions 2_proxima/diffusion-deepdive.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 9,
"id": "56c0b3b4-bdbc-4bc3-b034-68bc93ecefbc",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
]
}
],
"source": [
"%load_ext autoreload\n",
"%autoreload 2\n",
"\n",
"from glob import glob\n",
"from pathlib import Path\n",
"import json\n",
"\n",
"import matplotlib.pyplot as plt\n",
"from ase.io import read\n",
"\n",
"from cascade.utils import calculate_sqared_disp, unwrap_trajectory\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "a1119259-b615-488a-aa43-e5a06b2b0578",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-9fb85a0f',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=10-00f4d1ee',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=10-3edef378',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-c6b2fa55',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=10-c87f8b96',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-fc69a0ed',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-c530dbd2',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-e16683d7',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-d8af6f3e',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-526f7ee4',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-8e988302',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-2bcd06d4',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-39c7c71d',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-e74a3487',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=10-8b4dc1de',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=10-6126682e',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=10-3399d3ee',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-10ce8f31',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-a81cf9bb',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-b5e442bd',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-97d501be',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-01bd9480',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=10-2605a33c',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=10-7ac8dce3',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-6456c0b8',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=10-5121bf75',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=10-d6c11ef4',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-89979534',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-d980181e',\n",
" 'runs/nvt-fixed-temp/si-vacancy-2x2x2-temp=1573.0-method=lda-blend=0-382ae57a']"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"paths = glob('runs/nvt-fixed-temp/si*')\n",
"paths"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "e367384d-5846-4cc9-ab22-aa5f5e9211f5",
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
"{'file': None,\n",
" 'starting_strc': '../0_setup/initial-geometries/si-vacancy-2x2x2.vasp',\n",
" 'temperature': 1573.0,\n",
" 'timestep': 1,\n",
" 'calculator': 'lda',\n",
" 'ensemble': 'nvt',\n",
" 'temp_tau': 25,\n",
" 'stress_tau': 25.0,\n",
" 'steps': 40000,\n",
" 'seed': 5,\n",
" 'bulk_modulus': 98.0,\n",
" 'initial_volume': 1376.0,\n",
" 'model_type': 'ani',\n",
" 'initial_model': None,\n",
" 'initial_data': [],\n",
" 'ensemble_size': 2,\n",
" 'online_training': True,\n",
" 'training_epochs': 16,\n",
" 'training_batch_size': 32,\n",
" 'training_max_size': 512,\n",
" 'training_recency_bias': 1.0,\n",
" 'training_device': 'cpu',\n",
" 'target_error': 0.9,\n",
" 'error_history': 8,\n",
" 'retrain_freq': 40010,\n",
" 'min_target_frac': 1.0,\n",
" 'n_blending_steps': 0,\n",
" 'cascade_commit': '5fda70cf55730fb117bf65924cfd5fae9fd3b0ed',\n",
" 'my_commit': '5fda70cf55730fb117bf65924cfd5fae9fd3b0ed',\n",
" 'start_time': '2024-10-03T20:06:58.383766'}"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"path = Path(paths[0])\n",
"with open(path/'params.json', 'r') as f:\n",
" params = json.load(f)\n",
"params"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "af4a7ffc-772b-4034-8bd2-8951fd1687b1",
"metadata": {},
"outputs": [],
"source": [
"traj = read(path/'md.traj', index=':')"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "0828d1b8-a6a2-4db4-bf74-a309005b1bd1",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"KeyboardInterrupt\n",
"\n"
]
}
],
"source": [
"traj = unwrap_trajectory(traj)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "980667c4-bc4f-429b-9821-52416d63b189",
"metadata": {},
"outputs": [],
"source": [
"msd = cal"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit 584a16b

Please sign in to comment.