From e1929eaac4b3a880781800bec7bfa0abc6e2f543 Mon Sep 17 00:00:00 2001 From: Zihan <32484940+wzh4464@users.noreply.github.com> Date: Mon, 17 Jun 2024 17:11:40 +0800 Subject: [PATCH] math equations --- add_ctexart_comment.py | 42 +++++++++++++++++++++++++++++++++++++ cocluster_note/Cocluster.md | 8 +++---- 2 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 add_ctexart_comment.py diff --git a/add_ctexart_comment.py b/add_ctexart_comment.py new file mode 100644 index 0000000..ed44451 --- /dev/null +++ b/add_ctexart_comment.py @@ -0,0 +1,42 @@ +import glob + +### + # File: /add_ctexart_comment.py + # Created Date: Monday, June 17th 2024 + # Author: Zihan + # ----- + # Last Modified: Monday, 17th June 2024 4:31:23 pm + # Modified By: the developer formerly known as Zihan at + # ----- + # HISTORY: + # Date By Comments + # ---------- ------ --------------------------------------------------------- +### + +# Find all Markdown files recursively +md_files = glob.glob('**/*.md', recursive=True) + +# Comment to be added +comment = '''--- +toc: true +documentclass: "ctexart" +classoption: "UTF8" +--- +''' + +# Add the comment to each file +for file in md_files: + with open(file, 'r+') as f: + content = f.read() + f.seek(0, 0) + f.write(comment + content) + +# delete first blank lines +# for file in md_files: +# with open(file, 'r+') as f: +# content = f.readlines() +# f.seek(0, 0) +# for line in content: +# if line.strip() != '': +# f.write(line) +# f.truncate() \ No newline at end of file diff --git a/cocluster_note/Cocluster.md b/cocluster_note/Cocluster.md index ed8deec..4f92306 100644 --- a/cocluster_note/Cocluster.md +++ b/cocluster_note/Cocluster.md @@ -100,9 +100,7 @@ $$\min_{Z^\top D Z = I} \mathrm{Tr} (Z^\top L Z)$$ 优化目标成为 $$ -\begin{equation} \max_{U^\top U + V^\top V = I} \mathrm{Tr} (O) -\end{equation} $$ ### Proof @@ -137,7 +135,9 @@ $$ $$Z^\top L Z = I - O - O^\top$$ $$Z^\top D Z = U^\top U + V^\top V = I$$ 则直接计算有 -$$\begin{equation}\max_{U^\top U + V^\top V = I} \mathrm{Tr} (O)\end{equation}$$ +$$ +\max_{U^\top U + V^\top V = I} \mathrm{Tr} (O) +$$ ### Lemma 连续情况的优化 @@ -148,12 +148,10 @@ $$ 其中$M \in \mathbb{R}^{n_1 \times n_2}$,$X \in \mathbb{R}^{n_1 \times k}$,$Y \in \mathbb{R}^{n_2 \times k}$. 那么其解为 $$ -\begin{equation} \begin{cases} X = \frac{\sqrt{2}}{2} U_1 \\ Y = \frac{\sqrt{2}}{2} V_1 \end{cases} -\end{equation} $$ 其中,$U_1$和$V_1$是$M$前$k$个最大的奇异值对应的左右奇异向量. > Proof: