This commit is contained in:
Trance-0
2025-03-12 20:40:19 -05:00
11 changed files with 10341 additions and 9877 deletions

View File

@@ -3,6 +3,8 @@
FROM node:18-alpine AS base
ENV NODE_OPTIONS="--max-old-space-size=8192"
# 1. Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.

3
Jenkinsfile vendored
View File

@@ -1,7 +1,8 @@
pipeline {
environment {
registry = "trance0/NoteNextra"
registry = "trance0/notenextra"
version = "1.0"
NODE_OPTIONS = "--max-old-space-size=8192"
}
agent any

View File

@@ -3,7 +3,7 @@ services:
build:
context: ./
dockerfile: ./Dockerfile
image: trance0/notenextra:v1.1.5
image: trance0/notenextra:v1.1.7
restart: on-failure:5
ports:
- 13000:3000

19918
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,12 @@
{
"scripts": {
"dev": "next",
"build": "export NODE_OPTIONS=--max-old-space-size=8192 && next build",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@cloudflare/next-on-pages": "^1.13.7",
"@napi-rs/simple-git": "^0.1.19",
"@vercel/analytics": "^1.4.1",
"@vercel/speed-insights": "^1.1.0",
"next": "^15.0.3",

View File

@@ -16,4 +16,5 @@ export default {
CSE332S_L11: "Object-Oriented Programming Lab (Lecture 11)",
CSE332S_L12: "Object-Oriented Programming Lab (Lecture 12)",
CSE332S_L13: "Object-Oriented Programming Lab (Lecture 13)",
CSE332S_L14: "Object-Oriented Programming Lab (Lecture 14)",
}

View File

@@ -0,0 +1,77 @@
# CSE559A Lecture 14
## Neural Network Training
## Object Detection
AP (Average Precision)
### Benchmarks
#### PASCAL VOC Challenge
20 Challenge classes.
CNN increases the accuracy of object detection.
#### COCO dataset
Common objects in context.
Semantic segmentation. Every pixel is classified to tags.
Instance segmentation. Every pixel is classified and grouped into instances.
### Object detection: outline
Proposal generation
Object recognition
#### R-CNN
Proposal generation
Use CNN to extract features from proposals.
with SVM to classify proposals.
Use selective search to generate proposals.
Use AlexNet finetuned on PASCAL VOC to extract features.
Pros:
- Much more accurate than previous approaches
- Andy deep architecture can immediately be "plugged in"
Cons:
- Not a single end-to-end trainable system
- Fine-tune network with softmax classifier (log loss)
- Train post-hoc linear SVMs (hinge loss)
- Train post-hoc bounding box regressors (least squares)
- Training is slow 2000CNN passes for each image
- Inference (detection) was slow
#### Fast R-CNN
Proposal generation
Use CNN to extract features from proposals.
##### ROI pooling and ROI alignment
ROI pooling:
- Pooling is applied to the feature map.
- Pooling is applied to the proposal.
ROI alignment:
- Align the proposal to the feature map.
- Align the proposal to the feature map.
Use bounding box regression to refine the proposal.

View File

@@ -16,4 +16,5 @@ export default {
CSE559A_L11: "Computer Vision (Lecture 11)",
CSE559A_L12: "Computer Vision (Lecture 12)",
CSE559A_L13: "Computer Vision (Lecture 13)",
CSE559A_L14: "Computer Vision (Lecture 14)",
}

View File

@@ -1 +1,74 @@
# Lecture 21
# Math4121 Lecture 21
## Rolling from last lecture
### Convergence of integrals
#### Arzela-Osgood Theorem
Let $\{f_n\}$ be a sequence of function, $f(x)=\lim_{n\to\infty}f_n(x)$ for every $x\in [0,1]$, if $f\in \mathscr{R}[0,1]$, and $\exists B>0$ such that $|f_n(x)|\leq B \forall x\in [0,1]$. (uniformly bounded and integrable)
$$
\lim_{n\to\infty}\int_0^1 f_n(x) dx = \int_0^1 f(x) dx
$$
If we let $\Gamma_{\alpha}$ be the set of intervals where $f_n$ is not continuous,
$$
\Gamma_{\alpha} = \{x\in [0,1] : \textup{ for any }m\in \mathbb{N}, \delta > 0, \exists n\geq m, y\in (x-\delta, x+\delta) \text{ s.t. } |f_n(y)-f(y)|>\alpha\}
$$
Fact: $\Gamma_{\alpha}$ is closed and nowhere dense.
Proof:
Without loss of generality, we can assume $f=0$. Given any $\alpha > 0$, $\exists N$ such that
$$
\left|\int_0^1 f_n(x) dx \right| < \alpha
$$
for all $n\geq N$.
Consider the set $\Gamma_{\alpha/2} = \bigcup_{n=1}^{\infty} E_n$, for each $g\in \Gamma_{\alpha/2}$, we still have $\lim_{n\to\infty}f_n(g) = 0$.
So we define
$$
G_i=\{g\in \Gamma_{\alpha/2} :|f_n(g)|<\frac{\alpha}{2} \text{ for all }n\geq i\}
$$
So $G_1\subset G_2\subset \cdots$ and $\Gamma_{\alpha/2} = \bigcup_{i=1}^{\infty} G_i$.
By Osgood Lemma, since $\Gamma_{\alpha/2}$ is closed, $\exists K$ such that $c_e(G_K)>c_e(\Gamma_{\alpha/2})-\frac{\alpha}{4B}$.
By definition of $c_e$, we cna find open $I_1,\ldots,I_N$ which cover $\Gamma_{\alpha/2}$ and
$$
\sum_{i=1}^N \ell(I_i) < c_e(\Gamma_{\alpha/2})+\frac{\alpha}{4B}
$$
Let $\mathcal{U}=\bigcup_{i=1}^N I_i$, and $\mathcal{C}=[0,1]\setminus \mathcal{U}$.
Part 1: Control the integral on $\mathcal{C}$
for each $x\in \mathcal{C}$, $x\notin \Gamma_{\alpha/2}$, so $\exists$ and open interval $I(x)$ and an integer $m(x)$ such that $|f_{m(x)}(x)|<\frac{\alpha}{2}$ and $\forall n\geq m(x), y\in I(x)$
So $\mathcal{C}\subset \bigcup_{x\in \mathcal{C}} I(x)$, and $\mathcal{C}$ is closed and bounded, $\exists x_1,\ldots,x_J$ such that $\mathcal{C}\subset \bigcup_{j=1}^J I(x_j)$. So if $n\geq \max_{j=1,\ldots,J} m(x_j)$, and $x\in \mathcal{C}$, then $|f_n(x)|<\frac{\alpha}{2}$.
So $\int_\mathcal{C} |f_n(x)| dx < \frac{\alpha}{2} c_e(\mathcal{C})$.
Part 2: Control the integral on $\mathcal{U}$
If $[x_i,x_{i+1}]\cap G_k\neq \emptyset$, then $\inf_{x\in [x_i,x_{i+1}]} |f_n(x)| < \frac{\alpha}{2}$ for all $n\geq K$. Denote such set as $P_1$.
Otherwise, we denote such set as $P_2$.
So $\ell(\mathcal{U})=\ell(P_1)+\ell(P_2)\geq c_e(G_K)+\ell(P_2)$.
This implies $\ell(P_2)\leq \frac{\alpha}{4B}$.
Continue on Friday.
QED

View File

@@ -1 +1,123 @@
# Lecture 22
# Math 4121 Lecture 22
## Continue on Arzela-Osgood Theorem
Proof:
Part 2: Control the integral on $\mathcal{U}$
If $[x_i,x_{i+1}]\cap G_k\neq \emptyset$, then $\inf_{x\in [x_i,x_{i+1}]} |f_n(x)| < \frac{\alpha}{2}$ for all $n\geq K$. Denote such set as $P_1$.
Otherwise, we denote such set as $P_2$.
So $\ell(\mathcal{U})=\ell(P_1)+\ell(P_2)\geq c_e(G_K)+\ell(P_2)$.
This implies $\ell(P_2)\leq \frac{\alpha}{4B}$ since $c_e(G_K)\leq c_e(\mathcal{U})+\frac{\alpha}{2B}$.
Thus, for $n\geq K$,
$$
L(P,f_n)\leq \ell(P_1)\frac{\alpha}{2}+\ell(P_2)B
$$
So
$$
\int_\mathcal{U} |f_n(x)| dx \leq c_e(\mathcal{U})\frac{\alpha}{2}+\frac{\alpha}{2}
$$
All in all,
$$
\begin{aligned}
\left\vert \int_\mathcal{U} f_n(x) dx\right\vert &\leq \frac{\alpha}{2}+\frac{\alpha}{2}\\
&= \int_0^1 |f_n(x)| dx\\
&\leq \int_\mathcal{U} |f_n(x)| dx + \int_\mathcal{C} |f_n(x)|dx\\
&\leq c_e(\mathcal{U})\frac{\alpha}{2}+\frac{\alpha}{2}+c_e(\mathcal{C})\frac{\alpha}{2}\\
&= \alpha
\end{aligned}
$$
$\forall N\geq K$.
QED
### Baire Category Theorem
Nowhere dense sets can be large, but they canot cover an open (or closed) interval.
#### Theorem 4.7 (Baire Category Theorem)
An open interval cannot be covered by a countable union of nowhere dense sets.
Proof:
Suppose $(0,1)\subset \bigcup_{n=1}^\infty S_n$ where each $S_n$ is nowhere dense. In particular, $\exists I_1$ closed interval such that $I_1\subset (0,1)$ and $I_1\cap S_1=\emptyset$.
Now for each $k\geq 2$, $S_k$ is not dense in $I_{k-1}$ so $\exists I_k\subsetneq I_{k-1}$ such that $I_k\cap S_k=\emptyset$ for all $j\leq k$.
By nested interval property, $\exists x\in \bigcap_{n=1}^\infty I_n$.
Then $x\in (0,1)$ and $x\notin \bigcup_{n=1}^\infty S_n$.
Contradiction with the assumption that $(0,1)\subset \bigcup_{n=1}^\infty S_n$.
QED
#### Definition First Category
A countable union of nowhere dense sets is called a set of **first category**.
#### Corollary 4.8
Complement of a set of first category in $\mathbb{R}$ is dense in $\mathbb{R}$.
Proof:
We need to show that for every interval $I$, $\exists x\in I\cap S^c$. ($\exists x\in I$ and $x\notin S$)
This is equivalent to the Baire Category Theorem.
QED
Recall a function is pointwise discontinuous if $\mathcal{C}=\{c\in [a,b]: f\text{ is continuous at } c\}$ is dense in $[a,b]$.
$\mathcal{D}=[a,b]\setminus \mathcal{C}$ is called the set of points of discontinuity of $f$.
#### Corollary 4.9
$f$ is pointwise discontinuous if and only if $\mathcal{D}$ is of first category.
Proof:
Part 1: If $\mathcal{D}$ is of first category, then $f$ is pointwise discontinuous.
Immediate from Corollary 4.8.
Part 2: If $f$ is pointwise discontinuous, then $\mathcal{D}$ is of first category.
Let $P_k=\{x\in [a,b]: w(f;x)\geq \frac{1}{k}\}$, $\mathcal{D}=\bigcup_{k=1}^\infty P_k$.
Need to show that each $P_k$ is nowhere dense. (under the assumption that $\mathcal{C)$ is dense).
Let $I\subseteq [a,b]$ so $\exists c\in \mathcal{C}\cap I$. So by definition of $w(f;c)$, $\exists J\subseteq I$ and $c\in J$ such that $w(f;J)\leq \frac{1}{k}$ so for all $x\in J$, $w(f;x)\leq \frac{1}{k}$. so $J\subseteq P_k=\emptyset$.
Thus, $P_k$ is nowhere dense.
QED
#### Corollary 4.10
Let $\{f_n\}$ be a sequence of pointwise discontinuous functions. The set of points at which all $f_n$ are simultaneously continuous is dense (it's also uncountable).
Proof:
$$
\bigcap_{n=1}^\infty \mathcal{C}_n=\left(\bigcup_{n=1}^\infty \mathcal{D}_n\right)^c
$$
The complement of a set of first category is dense.
QED

View File

@@ -22,15 +22,9 @@ export default {
Math4121_L17: "Introduction to Lebesgue Integration (Lecture 17)",
Math4121_L18: "Introduction to Lebesgue Integration (Lecture 18)",
Math4121_L19: "Introduction to Lebesgue Integration (Lecture 19)",
Math4121_L20: {
display: 'hidden'
},
Math4121_L21: {
display: 'hidden'
},
Math4121_L22: {
display: 'hidden'
},
Math4121_L20: "Introduction to Lebesgue Integration (Lecture 20)",
Math4121_L21: "Introduction to Lebesgue Integration (Lecture 21)",
Math4121_L22: "Introduction to Lebesgue Integration (Lecture 22)",
Math4121_L23: {
display: 'hidden'
},