Skip to content

Commit

Permalink
math equations
Browse files Browse the repository at this point in the history
  • Loading branch information
wzh4464 committed Jun 17, 2024
1 parent 2ce4a14 commit e1929ea
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
42 changes: 42 additions & 0 deletions add_ctexart_comment.py
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
# -----
# 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()
8 changes: 3 additions & 5 deletions cocluster_note/Cocluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 连续情况的优化

Expand All @@ -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:
Expand Down

0 comments on commit e1929ea

Please sign in to comment.