Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
WangFeng18 committed Jun 18, 2023
1 parent 1abe284 commit 4afb46c
Show file tree
Hide file tree
Showing 127 changed files with 26,577 additions and 319 deletions.
Binary file added ckpt.pth
Binary file not shown.
Binary file added cov_cuda.pth
Binary file not shown.
Binary file added cov_torch.pth
Binary file not shown.
38 changes: 26 additions & 12 deletions explore.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,13 @@
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import sympy as sym\n",
"from sympy import *"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"from sympy import *\n",
"\n",
"def symbolize_matrix(matrix_prefix=\"k\"):\n",
" \"\"\"Symbolize a matrix with the given prefix.\n",
" \n",
Expand All @@ -37,11 +30,32 @@
" return A\n",
"\n",
"A = symbolize_matrix(\"a\")\n",
"K = symbolize_matrix(\"k\")\n",
"\n",
"B=A*K*(A.T)"
"B=A*(A.T)\n",
"\n",
"DB = symbolize_matrix(\"\\partial_B\")\n",
"# sum(diff(B[i,j], A[0,0]) for i in range(3) for j in range(3))\n",
"DB = sym.Matrix([\n",
" [diff(B[0,0], A[0,0]), diff(B[0,0], A[0,1]), diff(B[0,0], A[0,2]), diff(B[0,0], A[1,0]), diff(B[0,0], A[1,1]), diff(B[0,0], A[1,2]), diff(B[0,0], A[2,0]), diff(B[0,0], A[2,1]), diff(B[0,0], A[2,2])],\n",
" [diff(B[0,1], A[0,0]), diff(B[0,1], A[0,1]), diff(B[0,1], A[0,2]), diff(B[0,1], A[1,0]), diff(B[0,1], A[1,1]), diff(B[0,1], A[1,2]), diff(B[0,1], A[2,0]), diff(B[0,1], A[2,1]), diff(B[0,1], A[2,2])],\n",
" [diff(B[0,2], A[0,0]), diff(B[0,2], A[0,1]), diff(B[0,2], A[0,2]), diff(B[0,2], A[1,0]), diff(B[0,2], A[1,1]), diff(B[0,2], A[1,2]), diff(B[0,2], A[2,0]), diff(B[0,2], A[2,1]), diff(B[0,2], A[2,2])],\n",
" [diff(B[1,0], A[0,0]), diff(B[1,0], A[0,1]), diff(B[1,0], A[0,2]), diff(B[1,0], A[1,0]), diff(B[1,0], A[1,1]), diff(B[1,0], A[1,2]), diff(B[1,0], A[2,0]), diff(B[1,0], A[2,1]), diff(B[1,0], A[2,2])],\n",
" [diff(B[1,1], A[0,0]), diff(B[1,1], A[0,1]), diff(B[1,1], A[0,2]), diff(B[1,1], A[1,0]), diff(B[1,1], A[1,1]), diff(B[1,1], A[1,2]), diff(B[1,1], A[2,0]), diff(B[1,1], A[2,1]), diff(B[1,1], A[2,2])],\n",
" [diff(B[1,2], A[0,0]), diff(B[1,2], A[0,1]), diff(B[1,2], A[0,2]), diff(B[1,2], A[1,0]), diff(B[1,2], A[1,1]), diff(B[1,2], A[1,2]), diff(B[1,2], A[2,0]), diff(B[1,2], A[2,1]), diff(B[1,2], A[2,2])],\n",
" [diff(B[2,0], A[0,0]), diff(B[2,0], A[0,1]), diff(B[2,0], A[0,2]), diff(B[2,0], A[1,0]), diff(B[2,0], A[1,1]), diff(B[2,0], A[1,2]), diff(B[2,0], A[2,0]), diff(B[2,0], A[2,1]), diff(B[2,0], A[2,2])],\n",
" [diff(B[2,1], A[0,0]), diff(B[2,1], A[0,1]), diff(B[2,1], A[0,2]), diff(B[2,1], A[1,0]), diff(B[2,1], A[1,1]), diff(B[2,1], A[1,2]), diff(B[2,1], A[2,0]), diff(B[2,1], A[2,1]), diff(B[2,1], A[2,2])],\n",
" [diff(B[2,2], A[0,0]), diff(B[2,2], A[0,1]), diff(B[2,2], A[0,2]), diff(B[2,2], A[1,0]), diff(B[2,2], A[1,1]), diff(B[2,2], A[1,2]), diff(B[2,2], A[2,0]), diff(B[2,2], A[2,1]), diff(B[2,2], A[2,2])]\n",
"])\n",
"print(DB)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 11,
Expand Down
Loading

0 comments on commit 4afb46c

Please sign in to comment.